I look most of the previously asked questions but was not able to find answer for my question:
I have following data.frame
id year mont
This should be an efficient way:
sum_df = df.groupby(['year','month']).agg({'score': 'sum', 'num_attempts': 'sum'})