-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Broken bool supports in NumPy's percentile #19154
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
Comments
I am still not sure if this is actually a bad change, but it should not have happened without some warning. This was a regression in 1.20 already, though. |
We discussed this briefly, and should try to fix this (assuming it is not too tricky). And then backport it to the 1.20.x (one more release is anticipated there). That may include a Deprecation instead of the error though, since it is unclear that this is actually reasonable behaviour. |
The work on this branch has removed a handling of an unnecessary specific case (when indices are integers), which was covered by this test case. However, percentile/quantiles have been broken for a while when the input array is made of booleans, but it's not clear what should be done to fix this. The unit test case now behaves like any other boolean array and raise a TypeError. See - numpy#19857 (comment) - numpy#19154
- Added the missing linear interpolation methods. - Updated the existing unit tests. - Added pytest.mark.xfail for boolean arrays See - numpy#19857 (comment) - numpy#19154
- Added the missing linear interpolation methods. - Updated the existing unit tests. - Added pytest.mark.xfail for boolean arrays See - numpy#19857 (comment) - numpy#19154
- Added the missing linear interpolation methods. - Updated the existing unit tests. - Added pytest.mark.xfail for boolean arrays See - numpy#19857 (comment) - numpy#19154
- Added the missing linear interpolation methods. - Updated the existing unit tests. - Added pytest.mark.xfail for boolean arrays See - numpy#19857 (comment) - numpy#19154
- Added the missing linear interpolation methods. - Updated the existing unit tests. - Added pytest.mark.xfail for boolean arrays See - numpy#19857 (comment) - numpy#19154
This should have been fixed by the PR linked above. The test referencing this issue (with an XFAIL) is now passing. So I will close this (and try to remember to unmark that test, I was looking at some datetime related fixes in that corner.). |
#16273 (comment) broke the case of
percentile
with bools which causes to break pandas pandas'quantile
too:Before
After
Reproducing code example:
Error message:
Before (NumPy 1.19)
After
NumPy/Python version information:
The text was updated successfully, but these errors were encountered: