Skip to content

Instantly share code, notes, and snippets.

@thepycoach
Last active December 5, 2020 22:11
Show Gist options
  • Select an option

  • Save thepycoach/b5cffb3f938a2b954924e825ee5caa04 to your computer and use it in GitHub Desktop.

Select an option

Save thepycoach/b5cffb3f938a2b954924e825ee5caa04 to your computer and use it in GitHub Desktop.
#1.#transforming data bookie 1,2 and 3
df_tipico = pickle.load(open('df_tipico','rb'))
df_tipico = df_tipico[['Teams', 'btts']]
df_tipico = df_tipico.replace(r'', '0\n0', regex=True)#odds with no values
df_tipico = df_tipico.replace(r'^\d+\.\d+$', '0\n0', regex=True)#odds with only one element
df_bwin = pickle.load(open('df_bwin','rb'))
df_bwin = df_bwin[['Teams', 'btts']]
df_bwin = df_bwin.replace(r'', '0\n0', regex=True)
df_bwin = df_bwin.replace(r'^\d+\.\d+$', '0\n0', regex=True)
df_betfair = pickle.load(open('df_betfair','rb'))
df_betfair = df_betfair[['Teams', 'btts']]
df_betfair = df_betfair.replace(r'', '0\n0', regex=True)
df_betfair = df_betfair.replace(r'^\d+\.\d+$', '0\n0', regex=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment