Skip to content

Commit 870bc5c

Browse files
committed
BUG: Fix MultiIndex alignment issue in Dataframe-Series binary operation in case of different levels
1 parent f13cd4c commit 870bc5c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ MultiIndex
705705
- :meth:`MultiIndex.insert` would not insert NA value correctly at unified location of index -1 (:issue:`59003`)
706706
- :func:`MultiIndex.get_level_values` accessing a :class:`DatetimeIndex` does not carry the frequency attribute along (:issue:`58327`, :issue:`57949`)
707707
- Bug in :class:`DataFrame` arithmetic operations in case of unaligned MultiIndex columns (:issue:`60498`)
708+
- Bug in :class:`DataFrame` arithmetic operation with :class:`Series` in case of unaligned MultiIndex (:issue:`61009`)
708709
-
709710

710711
I/O

pandas/core/generic.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9636,10 +9636,7 @@ def _align_series(
96369636

96379637
left = self._constructor_from_mgr(fdata, axes=fdata.axes)
96389638

9639-
if ridx is None:
9640-
right = other.copy(deep=False)
9641-
else:
9642-
right = other.reindex(join_index, level=level)
9639+
right = other._reindex_indexer(join_index, ridx)
96439640

96449641
# fill
96459642
fill_na = notna(fill_value)

0 commit comments

Comments
 (0)