Reputation: 535
I have a df with several columns: 'hour', 'day', 'week', 'month', 'year' and 'value'. I've grouped by 'week' and 'hour' with 'value' looking for mean():
df_group = df.groupby(['week','hour']).value.mean().reset_index()
Now I want to apply that mean value as a separate column for each hour in each week. Any ideas? THanks in advance!
Upvotes: 1
Views: 37