Skip to content

Commit 25c8b40

Browse files
REF: simplify reindexing in _align_series()
Follow-up to #46058
1 parent 1c8199f commit 25c8b40

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

90119011
if is_series:
90129012
left = self._reindex_indexer(join_index, lidx, copy)
9013-
elif lidx is None:
9013+
elif lidx is None or join_index is None:
90149014
left = self.copy() if copy else self
90159015
else:
9016-
data = algos.take_nd(
9017-
self.values,
9018-
lidx,
9019-
allow_fill=True,
9020-
fill_value=None,
9021-
)
9022-
90239016
left = self._constructor(
9024-
data=data, columns=self.columns, index=join_index
9017+
self._mgr.reindex_indexer(join_index, lidx, axis=1, copy=copy)
90259018
)
90269019

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

0 commit comments

Comments
 (0)