Skip to content

BUG: Fix Behavior Change from #64366 Regarding NaN Handling With Mask#65372

Open
Alvaro-Kothe wants to merge 3 commits into
pandas-dev:mainfrom
Alvaro-Kothe:fix/revert-nan-mask-verification
Open

BUG: Fix Behavior Change from #64366 Regarding NaN Handling With Mask#65372
Alvaro-Kothe wants to merge 3 commits into
pandas-dev:mainfrom
Alvaro-Kothe:fix/revert-nan-mask-verification

Conversation

@Alvaro-Kothe
Copy link
Copy Markdown
Member

Pointed out by @jbrockmendel in #64848 (comment).

Previously NaN was checked only without a mask. After #64366 it's being checked unconditionally. Restore original behavior and adds tests for groupby and nanops.

Went back in history to check that the tests fails on b935209 and doesn't fail on 027ea1e, with the exception that nanskew and nankurt have shown the same wrong behavior as nansem regarding returning a scalar np.nan when using axis not None.

Comment thread pandas/_libs/algos.pyx Outdated
Comment thread pandas/tests/groupby/test_reductions.py Outdated
@Alvaro-Kothe Alvaro-Kothe force-pushed the fix/revert-nan-mask-verification branch from b80419e to d6e8b79 Compare April 26, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants