Skip to content

Commit ee4969f

Browse files
committed
PERF: Delete flag for sorting multiindex loc call.
1 parent e3dbdc5 commit ee4969f

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
@@ -3074,21 +3074,6 @@ def _reorder_indexer(
30743074
-------
30753075
indexer : a sorted Int64Index indexer of self ordered as seq
30763076
"""
3077-
# If the index is lexsorted and the list_like label in seq are sorted
3078-
# then we do not need to sort
3079-
if self.is_lexsorted():
3080-
need_sort = False
3081-
for i, k in enumerate(seq):
3082-
if is_list_like(k):
3083-
if not need_sort:
3084-
k_codes = self.levels[i].get_indexer(k)
3085-
k_codes = k_codes[k_codes >= 0] # Filter absent keys
3086-
# True if the given codes are not ordered
3087-
need_sort = (k_codes[:-1] > k_codes[1:]).any()
3088-
# Bail out if both index and seq are sorted
3089-
if not need_sort:
3090-
return indexer
3091-
30923077
n = len(self)
30933078
keys: Tuple[np.ndarray, ...] = tuple()
30943079
# For each level of the sequence in seq, map the level codes with the

0 commit comments

Comments
 (0)