Last active
December 6, 2020 02:29
-
-
Save thepycoach/426ed61806b6cb769c85611e4b61dde7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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