Skip to content

Commit 3bab36f

Browse files
author
Jean-Francois Zinque
committed
PERF: Avoid sorting twice in intersection of numeric MultiIndex
1 parent 6b8f2d7 commit 3bab36f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pandas/core/indexes/multi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,6 +3331,7 @@ def intersection(self, other, sort=False):
33313331
if self.is_monotonic and other.is_monotonic:
33323332
try:
33333333
uniq_tuples = self._inner_indexer(lvals, rvals)[0]
3334+
sort = False # uniq_tuples is already sorted
33343335
except TypeError:
33353336
pass
33363337

0 commit comments

Comments
 (0)