I have a DataFrame as such
│ Row │ start │ finish │ cals │ DOW │
│ │ DateTime │ DateTime │ Float64 │ Int64 │
├─────┼─────────────────────┼─────────────────────┼─────────┼───────┤
│ 1 │ 2017-07-19T16:58:00 │ 2017-07-19T17:58:00 │ 0.073 │ 3 │
│ 2 │ 2017-07-19T18:08:00 │ 2017-07-19T18:09:00 │ 0.163 │ 3 │
│ 3 │ 2017-07-19T18:09:00 │ 2017-07-19T18:18:00 │ 0.057 │ 3 │
│ 4 │ 2017-07-19T18:18:00 │ 2017-07-19T18:19:00 │ 0.443 │ 3 │
│ 5 │ 2017-07-19T18:19:00 │ 2017-07-19T18:20:00 │ 1.086 │ 3 │
The :cals
column represents calories burned, and the :DOW
represents the day of the week.
What I would like to do is sum up the calories for each day, and then group by day of the week.
Hence, after summing, a new DataFrame might look like
│ Row │ day │ cals │ DOW │
│ │ DateTime │ Float64 │ Int64 │
├─────┼────────────┼─────────┼───────┼
│ 1 │ 2017-07-19 │ 532 │ 3 │
│ 2 │ 2017-07-20 │ 234 │ 4 │
│ 3 │ 2017-07-21 │ 765 │ 5 │
│ 4 │ 2017-07-22 │ 123 │ 6 │
│ 5 │ 2017-07-23 │ 567 │ 7 │
However, I’m getting stuck on how to sum up the calories over each individual day.
Does anyone have any suggestions?