riptable icon indicating copy to clipboard operation
riptable copied to clipboard

Count not being supported in multiset agg function

Open HYPERTONE opened this issue 2 years ago • 0 comments

GroupByOps has AggNames listed as a set: AggNames = { "count", "cumsum", "cummin", "cummax", "first", "last", "max", "mean", "median", "min", "nanmax", "nanmean", "nanmedian", "nanmin", "nanstd", "nansum", "nanvar", "nth", "std", "sum", "var", }

However, upon performing a groupby with 'count', the following occurs: dataset.groupby(['Category', 'SubCategory']).agg({'Identifier' : 'count', 'Value' : 'max'})

TypeError: count() takes 1 positional argument but 2 were given

This can similarly be done in pandas via the following:

df.groupby(['Category', 'SubCategory']).agg({'Identifier' : 'count', 'Value' : 'max'})

HYPERTONE avatar Aug 25 '23 18:08 HYPERTONE