Skip to content

Commit ed33d00

Browse files
author
Jean-Francois Zinque
committed
PERF: Avoid sorting twice in intersection of numeric MultiIndex
1 parent 058912c commit ed33d00

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pandas/core/indexes/multi.py

+1
Original file line numberDiff line numberDiff line change
@@ -3321,6 +3321,7 @@ def intersection(self, other, sort=False):
33213321
if self.is_monotonic and other.is_monotonic:
33223322
try:
33233323
uniq_tuples = self._inner_indexer(lvals, rvals)[0]
3324+
sort = False # uniq_tuples is already sorted
33243325
except TypeError:
33253326
pass
33263327

0 commit comments

Comments
 (0)