I have the following dataframe (50000 lines for 2016,2017,2018):
data.head() Values Date 2016-07-20 10.0 2016-07-20 10.0 2016-07-22 1.0 2016-07-22 1.0 2016-07-22 1.0 simple groupby :
data.groupby([(data1.index.year==2018),(data1.index.month==5)])['Values'].sum() False False 1461787.35 True 80714.53 True False 862589.66 True 172600.04 Name: Values, dtype: float64 How can I change False and True in year and month to 2018 and 5 ?
Output expected :
2018 5 80714.53 Name: Values, dtype: float64