riptable
riptable copied to clipboard
Count not being supported in multiset agg function
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'})