I have pandas DataFrame with many rows and columns, only three rows shown here:
date place number
2010 LON 10
2010 BER 20
2010 LON 5
2011 LON 10
2011 BER 15
2011 BER 10
I want to make a new dataframe which aggregates by year and sums up the number according to place:
date place number
2010 LON 15
2010 BER 20
2011 LON 10
2011 BER 25
I have tried many combinations of groupby with sum, inplace etc. But I cannot achieve this, any suggestions?