Skip to content
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 bug in DataFrame binary op not respecting fill_value in case… #60906

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

snitish
Copy link
Contributor

@snitish snitish commented Feb 10, 2025

… of MultiIndex columns

When fill_value is not None, we should not reindex the dataframes, as the _arith_method_with_reindex method doesn't handle fill_value. Instead, we should go via the regular _flex_arith_method route as reindexing is no longer necessary when fill_value is provided.

Bug introduced in #60538 so not adding to whatsnew.

@mroeschke mroeschke added this to the 3.0 milestone Feb 10, 2025
@mroeschke mroeschke added Numeric Operations Arithmetic, Comparison, and Logical operations MultiIndex labels Feb 10, 2025
@mroeschke mroeschke merged commit 8f802cd into pandas-dev:main Feb 10, 2025
47 of 48 checks passed
@mroeschke
Copy link
Member

Thanks for the quick follow up @snitish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Adding DataFrames with misaligned MultiIndex produces NaN despite fill_value=0
2 participants