1
1
import datetime
2
2
from sys import getsizeof
3
- from typing import Any , Hashable , List , Optional , Sequence , Union
3
+ from typing import Any , Hashable , Iterable , List , Optional , Sequence , Tuple , Union
4
4
import warnings
5
5
6
6
import numpy as np
9
9
10
10
from pandas ._libs import Timestamp , algos as libalgos , index as libindex , lib , tslibs
11
11
from pandas ._libs .hashtable import duplicated_int64
12
+ from pandas ._typing import AnyArrayLike , ArrayLike , Scalar
12
13
from pandas .compat .numpy import function as nv
13
14
from pandas .errors import PerformanceWarning , UnsortedIndexError
14
15
from pandas .util ._decorators import Appender , cache_readonly
42
43
ensure_index ,
43
44
)
44
45
from pandas .core .indexes .frozen import FrozenList
45
- from pandas .core .indexes .numeric import Int64Index
46
46
import pandas .core .missing as missing
47
47
from pandas .core .sorting import (
48
48
get_group_index ,
@@ -3068,7 +3068,9 @@ def _update_indexer(idxr, indexer=indexer):
3068
3068
3069
3069
return indexer ._ndarray_values
3070
3070
3071
- def _reorder_indexer (self , seq , indexer : Int64Index ) -> Int64Index :
3071
+ def _reorder_indexer (
3072
+ self , seq : Tuple [Union [Scalar , Iterable , AnyArrayLike ], ...], indexer : ArrayLike
3073
+ ) -> ArrayLike :
3072
3074
"""
3073
3075
Reorder an indexer of a MultiIndex (self) so that the label are in the
3074
3076
same order as given in seq
@@ -3082,10 +3084,8 @@ def _reorder_indexer(self, seq, indexer: Int64Index) -> Int64Index:
3082
3084
-------
3083
3085
indexer : a sorted Int64Index indexer of self ordered as seq
3084
3086
"""
3085
- from typing import Tuple
3086
-
3087
3087
n = len (self )
3088
- keys = tuple () # type: Tuple[np.ndarray, ...]
3088
+ keys = tuple ()
3089
3089
# For each level of the sequence in seq, map the level codes with the
3090
3090
# order they appears in a list-like sequence
3091
3091
# This mapping is then use to reorder the indexer
0 commit comments