pandas dataframe group year index by decade,df.groupby(df.index.year // 10 * 10).sum()