pandas dataframe groupby datetime month,df.groupby(pd.TimeGrouper(freq='M'))