how to get groupby data in dataframe pandas code example Example: pandas groupby data.groupby('month', as_index=False).agg({"duration": "sum"})