We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is basically what pandas.pivot_table does. Here's a naive implementation. I imagine this could be done more efficiently though.
julia> function wrap_reduce(df, aggregator, val, keys...) grp = groupby(df, collect(keys)) agg = combine(grp, val => aggregator => :_val) wrapdims(agg, :_val, keys...) end julia> df = DataFrame([ 1 1 1 1 1 2 2 3 2 5 ], ["x", "y"]) julia> wrap_reduce(df, sum, :y, :x) 1-dimensional KeyedArray(NamedDimsArray(...)) with keys: ↓ x ∈ 2-element Vector{Int64} And data, 2-element Vector{Int64}: (1) 4 (2) 8
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is basically what pandas.pivot_table does. Here's a naive implementation. I imagine this could be done more efficiently though.
The text was updated successfully, but these errors were encountered: