Skip to content

Instantly share code, notes, and snippets.

@AnasAlmasri
Created May 9, 2020 17:54
Show Gist options
  • Save AnasAlmasri/1675ffae58094fb28fb0b951f0532ad5 to your computer and use it in GitHub Desktop.
Save AnasAlmasri/1675ffae58094fb28fb0b951f0532ad5 to your computer and use it in GitHub Desktop.
# create a list of dataframes for each year
df_yearly = []
for year in stats.keys():
# create dataframe
tmp_df = pd.DataFrame(stats[year])
# add 'year' column to dataframe
tmp_df['year'] = year
df_yearly.append(tmp_df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment