Skip to content

Conversation

snitish
Copy link
Member

@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