Closed milanhej closed 1 year ago
Here is an odd result I obtained (Julia 1.6.1)
using DataFrames, DataFrameMacros, Chain, CSV iris = CSV.read("iris.csv", DataFrame); g = groupby(iris, "Species"); combine(g, nrow) 3×2 DataFrame Row │ Species nrow │ String Int64 ─────┼──────────────────────── 1 │ Iris-setosa 50 2 │ Iris-versicolor 50 3 │ Iris-virginica 50 @chain iris begin @groupby(:Species) @combine(:count = nrow) end Row │ Species count │ String #nrow… ─────┼───────────────────────── 1 │ Iris-setosa nrow 2 │ Iris-versicolor nrow 3 │ Iris-virginica nrow
Is there a separate function using DataFrameMacros to obtain counts of group instances?
Thanks.
this now exists as @combine(..., @nrow) so it doesn't interfere with other syntax https://github.com/jkrumbiegel/DataFrameMacros.jl/pull/25
@combine(..., @nrow)
Here is an odd result I obtained (Julia 1.6.1)
Is there a separate function using DataFrameMacros to obtain counts of group instances?
Thanks.