df.drop_duplicates(subset=['weekday', 'week'], inplace=True)
df2 = df.pivot(columns='week', index='weekday', values='activity')
df2.fillna(0, inplace=True)
How to create an activity plot from Pandas Dataframe (like the Github contribution plot)