Reputation: 446
How do one get a SQL-style grouped output when grouping following data:
item frequency
A 5
A 9
B 2
B 4
C 6
df.groupby(by = ["item"]).sum()
results in this:
item frequency
A 14
B 6
C 6
In pandas it is achieved by setting as_index=False
. But dask doesn't support this argument in groupby. It currently omits item
column and returns the series with frequency
column.
Upvotes: 5
Views: 2049