# NOT working:
spending_df.group_by([:year, :category]).aggregate(spending: :sum)
# working:
spending_df.group_by([:year, :category]).sum
# Expected result -- we should have
spending_df.group_by([:year, :category]).aggregate(spending: :sum) == spending_df.group_by([:year, :category]).sum
Hello,
example: (fictional) spending of a startup
ISSUE
Origin?
PR #340 was likely merged too soon
This test doesn't really check multi-indexed aggregation (cf same number of rows before/after the group_by+aggregation)
Suggestion
It is possible to optimize groupping and aggregation but getting away with the intermediary dataframe generated by Daru::Dataframe#group_by
I propose to add
Daru::Dataframe#group_by_and_aggregate
.FIX
I have a PR ready : #454
It builds on and refactors PR #330 and PR #340.
I think it is also a continuation/improvement along #152.