Skip to content

Commit aec76fc

Browse files
REF: simplify reindexing in _align_series()
Follow-up to #46058
1 parent 471319b commit aec76fc

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
@@ -9012,18 +9012,11 @@ def _align_series(
90129012

90139013
if is_series:
90149014
left = self._reindex_indexer(join_index, lidx, copy)
9015-
elif lidx is None:
9015+
elif lidx is None or join_index is None:
90169016
left = self.copy() if copy else self
90179017
else:
9018-
data = algos.take_nd(
9019-
self.values,
9020-
lidx,
9021-
allow_fill=True,
9022-
fill_value=None,
9023-
)
9024-
90259018
left = self._constructor(
9026-
data=data, columns=self.columns, index=join_index
9019+
self._mgr.reindex_indexer(join_index, lidx, axis=1, copy=copy)
90279020
)
90289021

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

0 commit comments

Comments
 (0)