I know there is a simple implementation for this, but I canβt remember the syntax. Have a simple pandas time series, and I want to summarize the data by month. In particular, I want to add data for several months and years to get some information about this. You can write it in slices, but I remember how the syntax does it automatically.
import pandas as pd df = Series(randn(100), index=pd.date_range('2012-01-01', periods=100))
A multi-indexed series over the years and months at the end of the month would be assigned as the first prize.
Partial Answer:
ds.resample('M', how=sum)
Any idea how to get elegantly multi-indexed over years?
source share