I'm working with a DataFrame where column1 is a DateTime type and all other columns are Float64 and represent hourly water use. The DataFrame spans 2 years of water use recorded at hourly intervals for every day and looks something like this.
Date | UserID1 | UserID2 | UserID3 | ...
DateTime | Float64 | Float64 | Float64 | ...
---------------------------------------------------------
2017-01-01 00:00:00 | 1.5 | 22.5 | 5.5 | ...
2017-01-01 01:00:00 | 4.5 | 3.2 | 9.12 | ...
.
.
.
2019-12-31 22:00:00 | 4.2 | 7.6 | 8.9 | ...
2029-12-31 23:00:00 | 3.2 | 0.9 | 11.2 | ...
I'd like to use groupby to sum water use for all users over each month.
In Pandas I could easily do something like
df.groupby(df.index.month).sum()
I can't figure out an analogy for Julia DataFrames. Im using CSV, DataFrames, and Dates packages. I can loop through each entry in the Date column like
for i in df.Date
if day(i) == 1
.
.
.
But I'd really like to use groupby because its such a large DataFrame and I have several other functions I'd like to perform other than sum