Created
July 27, 2020 06:37
-
-
Save naenumtou/f2f6861d29e79eafb497351ab8f86a07 to your computer and use it in GitHub Desktop.
This file contains 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
#Convert values | |
df['date'] = pd.to_datetime(df['date']) | |
df['total'] = pd.to_numeric(df['total']) | |
#Summary table | |
df = pd.pivot_table(df, index = ['country','date'], columns = ['types'], aggfunc = np.sum) | |
df.columns = df.columns.droplevel(0) | |
df = df.reset_index() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment