-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Series|Expr.rank
#1342
base: main
Are you sure you want to change the base?
Conversation
# crazy workaround for the case of `na_option="keep"` and nullable | ||
# integer dtypes. This should be supported in pandas > 3.0 | ||
# https://github.com/pandas-dev/pandas/issues/56976 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the workaround.
@MarcoGorelli I was not able to properly use the pandas like util function get_dtype_backend
to figure out the nullable backend. It should not really matter as the non-nullable backend would not result in integer type if the series contains nulls anyway
constructor: Constructor, | ||
method: Literal["average", "min", "max", "dense", "ordinal"], | ||
) -> None: | ||
if "polars" not in str(constructor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well π₯²
Hey @adamblake, this is an initial implementation to support |
What type of PR is this? (check all applicable)
Related issues
Checklist
If you have comments or can explain your changes, please do so below.
This PR provides initial support for rank method. I will start it as a draft due to a bunch of shortcomings:
df.groupby(keys)[cols].rank(*args, **kwargs)
, and this does not even return an aggregated value. Maybe we could support it if that's the only expression passed in the context, yet we need to figure out how to pass the arguments along. This is relevant sinceover
is implemented as agroup_by
under the hood.pyarrow.compute.rank
which is available but not exposed/documented (?)