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 @@ -3008,11 +3008,12 @@ def _update_indexer(idxr, indexer=indexer):
3008
3008
# a collection of labels to include from this level (these
3009
3009
# are or'd)
3010
3010
indexers = None
3011
- # Find out if the list_like label are sorted as the levels or not
3012
- k_codes = np .array (
3013
- [self .levels [i ].get_loc (e ) for e in k if e in self .levels [i ]]
3014
- )
3015
- need_sort = not (k_codes [:- 1 ] < k_codes [1 :]).all ()
3011
+ if not need_sort :
3012
+ # Find out if the list_like label are sorted as the levels or not
3013
+ k_codes = np .array (
3014
+ [self .levels [i ].get_loc (e ) for e in k if e in self .levels [i ]]
3015
+ )
3016
+ need_sort = not (k_codes [:- 1 ] < k_codes [1 :]).all ()
3016
3017
for x in k :
3017
3018
try :
3018
3019
idxrs = _convert_to_indexer (
@@ -3044,7 +3045,7 @@ def _update_indexer(idxr, indexer=indexer):
3044
3045
elif com .is_null_slice (k ):
3045
3046
# empty slice
3046
3047
# index is given to conserve the order of this level
3047
- indexer = _update_indexer (Int64Index ( np . arange ( n )) , indexer = indexer )
3048
+ indexer = _update_indexer (None , indexer = indexer )
3048
3049
3049
3050
elif isinstance (k , slice ):
3050
3051
You can’t perform that action at this time.
0 commit comments