Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- p_confrontations = 'Totally, 7 game(s) over, 8 game(s) under 7 game(s) half-game over, 8'
- over_under = re.findall(r'Totally, (\d+) game\(s\) over, (\d+)', p_confrontations)
- over_under_ratio = int(over_under[0][0])/(int(over_under[0][0])+int(over_under[0][1]))
- over_under2 = re.findall(r'(\d+) game\(s\) half-game over, (\d+)', p_confrontations)
- over_under2_ratio = int(over_under2[0][0])/(int(over_under2[0][0])+int(over_under2[0][1]))
- head_to_heads = dict()
- head_to_heads['over/under 0.75'] = over_under_ratio
- head_to_heads['over/under 2.5'] = over_under2_ratio
- print(head_to_heads)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement