File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3060,11 +3060,12 @@ def _update_indexer(idxr, indexer=indexer):
3060
3060
# a collection of labels to include from this level (these
3061
3061
# are or'd)
3062
3062
indexers = None
3063
- # Find out if the list_like label are sorted as the levels or not
3064
- k_codes = np .array (
3065
- [self .levels [i ].get_loc (e ) for e in k if e in self .levels [i ]]
3066
- )
3067
- need_sort = not (k_codes [:- 1 ] < k_codes [1 :]).all ()
3063
+ if not need_sort :
3064
+ # Find out if the list_like label are sorted as the levels or not
3065
+ k_codes = np .array (
3066
+ [self .levels [i ].get_loc (e ) for e in k if e in self .levels [i ]]
3067
+ )
3068
+ need_sort = not (k_codes [:- 1 ] < k_codes [1 :]).all ()
3068
3069
for x in k :
3069
3070
try :
3070
3071
idxrs = _convert_to_indexer (
@@ -3096,7 +3097,7 @@ def _update_indexer(idxr, indexer=indexer):
3096
3097
elif com .is_null_slice (k ):
3097
3098
# empty slice
3098
3099
# index is given to conserve the order of this level
3099
- indexer = _update_indexer (Int64Index ( np . arange ( n )) , indexer = indexer )
3100
+ indexer = _update_indexer (None , indexer = indexer )
3100
3101
3101
3102
elif isinstance (k , slice ):
3102
3103
You can’t perform that action at this time.
0 commit comments