Skip to content

Commit 7fee53c

Browse files
committed
PERF: Delete flag for sorting multiindex loc call.
1 parent 0e12376 commit 7fee53c

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

pandas/core/indexes/multi.py

-15
Original file line numberDiff line numberDiff line change
@@ -3071,21 +3071,6 @@ def _reorder_indexer(
30713071
-------
30723072
indexer : a sorted Int64Index indexer of self ordered as seq
30733073
"""
3074-
# If the index is lexsorted and the list_like label in seq are sorted
3075-
# then we do not need to sort
3076-
if self.is_lexsorted():
3077-
need_sort = False
3078-
for i, k in enumerate(seq):
3079-
if is_list_like(k):
3080-
if not need_sort:
3081-
k_codes = self.levels[i].get_indexer(k)
3082-
k_codes = k_codes[k_codes >= 0] # Filter absent keys
3083-
# True if the given codes are not ordered
3084-
need_sort = (k_codes[:-1] > k_codes[1:]).any()
3085-
# Bail out if both index and seq are sorted
3086-
if not need_sort:
3087-
return indexer
3088-
30893074
n = len(self)
30903075
keys: Tuple[np.ndarray, ...] = tuple()
30913076
# For each level of the sequence in seq, map the level codes with the

0 commit comments

Comments
 (0)