joinery icon indicating copy to clipboard operation
joinery copied to clipboard

GroupBy on a DataFrame based on a list and then get the size of a selected column for each Group

Open Bishnup1995 opened this issue 7 years ago • 1 comments

Example : res['NonNullCount'] = res.groupby(sortOrder)['column'].transform(lambda x: x.count()).astype(int) The above we can do in pandas. How can we do it in Joinery?

Bishnup1995 avatar Dec 26 '18 14:12 Bishnup1995

groupBy then count will get you the counts. Then I think you can get the desired result by dropping any extra columns.

cardillo avatar Dec 31 '18 16:12 cardillo