Skip to content

Instantly share code, notes, and snippets.

@thepycoach
Last active December 6, 2020 02:29
Show Gist options
  • Select an option

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

Select an option

Save thepycoach/426ed61806b6cb769c85611e4b61dde7 to your computer and use it in GitHub Desktop.
import pandas as pd
import pickle
#7 #unlimited columns
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
#Storing lists within dictionary
dict_gambling = {'Teams': teams, 'btts': btts,
'Over/Under': over_under, '3-way': x12}
#Presenting data in dataframe
df_tipico = pd.DataFrame.from_dict(dict_gambling)
#clean leading and trailing whitespaces of all odds
df_tipico = df_tipico.applymap(lambda x: x.strip() if isinstance(x, str) else x)
#Save data with Pickle
output = open('df_tipico', 'wb')
pickle.dump(df_tipico, output)
output.close()
print(df_tipico)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment