-
-
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: fix #59965 skipna=True operations don't skip NaN in FloatingArrays #59997
base: main
Are you sure you want to change the base?
Conversation
cooolheater
commented
Oct 7, 2024
•
edited
Loading
edited
- closes BUG: skipna=True operations don't skip NaN in FloatingArrays #59965
- Tests added and passed if fixing a bug or adding a new feature
- All code checks passed.
…oatingArrays - Issue: The skipna was not properly handled for BaseMaskedArray - Fix: Added mask for NA values - Test: Added test to series/test_reductions since the test uses
c73603f
to
cc63891
Compare
581665a
to
edc977e
Compare
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.
I think this looks good! Also will need a whatsnew note in the Numeric section of v3.0.0.rst
.
series1 = Series({"a": 0.0, "b": 1, "c": 1}, dtype="Float64") | ||
series2 = Series({"a": 0.0, "b": 2, "c": 2}, dtype="Float64") | ||
result = series1 / series2 | ||
assert pd.notna(result.mean(skipna=True)) |
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.
Nit: can you assert the value here (it is a slightly stronger test). Can use np.isclose
.
Apologies @cooolheater - based on the discussion in the linked issue, I think we have to hold off making changes here until a consensus is reached on how to handle various NA values across pandas. There is already a PDEP in progress for this, but it will likely be quite some time until we're ready for this change. |