SHARE
TWEET

Untitled

a guest Dec 6th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import re
  2. p_confrontations = 'Totally, 7 game(s) over, 8 game(s) under 7 game(s) half-game over, 8'
  3. over_under = re.findall(r'Totally, (\d+) game\(s\) over, (\d+)', p_confrontations)
  4. over_under_ratio = int(over_under[0][0])/(int(over_under[0][0])+int(over_under[0][1]))
  5. over_under2 = re.findall(r'(\d+) game\(s\) half-game over, (\d+)', p_confrontations)
  6. over_under2_ratio = int(over_under2[0][0])/(int(over_under2[0][0])+int(over_under2[0][1]))
  7. head_to_heads = dict()
  8. head_to_heads['over/under 0.75'] = over_under_ratio
  9. head_to_heads['over/under 2.5'] = over_under2_ratio
  10. print(head_to_heads)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top