sharkutilities / pandas-wizard

Utility Functions, Wrappers (w/o exotic dependencies) for pandas Library
https://pypi.org/project/pandas-wizard/
MIT License
4 stars 0 forks source link

[New Feature/Enhancement]: Ranking Function #10

Closed nxlogics closed 4 months ago

nxlogics commented 4 months ago

What is the New Feature/Enhancement?

The groupby method does not allow .rank() usage. This can be mimicked by using scipy.stats.rankdata() function.

Code of Conduct

ZenithClown commented 4 months ago

This cannot be done with a group by, as frame.groupby(...).agg({"feature" : [sum, pdw.rank()]}) does not makes any sense. The rank has to be outside the scope of the grouping clause.