-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: BooleanArray.any with all False values and skipna=False is buggy #33253
Comments
And the same for
|
@TomAugspurger I think it is quite obvious that the result should be same here for |
Agreed with your proposed changes to the return values. |
It seems that checking if there is any NA in both .any() method and .all() method right after the second else clause may solve this issue based on the table #29686. I am new to open source and just looking around. I was wondering whether I can have a try if you believe this issue is suitable for a beginner? |
@linxiaow Yes, this issue should be suitable. A pull request is very welcome! |
I took a look at the code pandas/pandas/core/arrays/boolean.py Lines 517 to 526 in 37dc5dc
I quickly went through previous code and find a docstring for mask variable pandas/pandas/core/arrays/boolean.py Lines 239 to 241 in 37dc5dc
I would assume self._mask in line 518 is also 1d ndarray, and I believe a .any() method for self._mask in line 523 would be enough to know whether there is a missing value. Same for .all(). If I am right, I can make a PR ASAP |
@linxiaow that sounds about right! So PR welcome, that will also be easier to give feedback (and I would also advice to first write tests, so you can actually check if your fix is working) |
@jorisvandenbossche I made a PR but it seems to fail the CI PR tests. A lot of PR fails, too. I am not sure what I missed. Any suggestions? |
…uction.py related to issue pandas-dev#33253
@jorisvandenbossche Right now I am dealing with whatsnew entry requested by PR here. I am confused with API reference to the issue we are closing. Here is what I have written under 1.1.0, bug fixed, Missing:
I did not pass the web and doc test, and I think that I do not reference the API in the correct way for |
…n/test_reduction.py based on change suggestions related to issue pandas-dev#33253
From a report on my blog, this seems buggy:
I don't think there is a reason to return NA if there are no NAs in the array? (even with
skipna=False
)We probably need to do a check for the presence of any NA here in the
else
clause:pandas/pandas/core/arrays/boolean.py
Lines 520 to 526 in 37dc5dc
The text was updated successfully, but these errors were encountered: