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
BUG: Do not raise deprecation warning for all nans in unique #19301
Conversation
Thanks @thomasjpfan, LGTM. |
…9301) This PR adjusts np.unique for the edge cases where all values are nan. Fixes numpygh-19300
BUG: Do not raise deprecation warning for all nans in unique (#19301)
This changed the result of |
Oh, I missed that :(. @thomasjpfan do you want to have a look? If there is an argument to be made for returning only one NaN, that would indeed be a separate thing. |
Sorry, this should have been on #18070 which changed the behaviour. Maybe that made this fix necessary though. |
In scikit-learn, we have a custom |
I came across this from a comparison of the Array API spec to NumPy. The spec returns multiple
but that may be because NumPy used to also return multiple |
Yeah, we changed in 1.21, it has a release note, but I don't think the list was pinged on it, which would have been good. I have send a mail to the list now. I lean towards just rolling with it, but lets see what everyone thinks, maybe I am missing something anyway. |
Fixes gh-19300
This PR adjusts
np.unique
for the edge cases where all values are nan.