Skip to content
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

Check if NPY_NAT is NA for int64 in rank() (#32859) #35533

Closed
wants to merge 1 commit into from

Conversation

gabrielNT
Copy link
Contributor

@gabrielNT gabrielNT commented Aug 4, 2020

Used missing.isnaobj() to try to handle the suggestion from @jbrockmendel. Lmk if this might cause other issues.

@WillAyd
Copy link
Member

WillAyd commented Aug 4, 2020

Seems reasonable. Can you run the benchmarks for this to make sure it doesn't introduce a regression?

@WillAyd WillAyd added the NA - MaskedArrays Related to pd.NA and nullable extension arrays label Aug 4, 2020
@@ -840,7 +840,7 @@ def rank_1d(
elif rank_t is float64_t:
mask = np.isnan(values)
elif rank_t is int64_t:
mask = values == NPY_NAT
mask = missing.isnaobj(values)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to be all-False

We probably need to specifically handle datetimelike case in which the existing check is correct

@gabrielNT
Copy link
Contributor Author

Hmmm, I think I misunderstood what types should return true. I'll revisit this another time if I get the chance.

@gabrielNT gabrielNT closed this Aug 18, 2020
@gabrielNT gabrielNT deleted the null_rank branch August 18, 2020 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rank() for int64 gives NAN for most negative value
3 participants