Skip to content

Commit 402d07a

Browse files
johannes-muelleryehoshuadimarsky
authored andcommitted
REF: simplify reindexing in _align_series() (pandas-dev#46266)
1 parent 61d4e80 commit 402d07a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pandas/core/generic.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -9023,18 +9023,11 @@ def _align_series(
90239023

90249024
if is_series:
90259025
left = self._reindex_indexer(join_index, lidx, copy)
9026-
elif lidx is None:
9026+
elif lidx is None or join_index is None:
90279027
left = self.copy() if copy else self
90289028
else:
9029-
data = algos.take_nd(
9030-
self.values,
9031-
lidx,
9032-
allow_fill=True,
9033-
fill_value=None,
9034-
)
9035-
90369029
left = self._constructor(
9037-
data=data, columns=self.columns, index=join_index
9030+
self._mgr.reindex_indexer(join_index, lidx, axis=1, copy=copy)
90389031
)
90399032

90409033
right = other._reindex_indexer(join_index, ridx, copy)

0 commit comments

Comments
 (0)