File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -867,7 +867,7 @@ def _ob_index_and_ids(
867867 names = names ,
868868 verify_integrity = False ,
869869 )
870- if not consistent_sorting :
870+ if not consistent_sorting and len ( ob_index ) > 0 :
871871 # Sort by the levels where the corresponding sort argument is True
872872 n_levels = len (sorts )
873873 drop_levels = [
@@ -881,9 +881,7 @@ def _ob_index_and_ids(
881881 sorter = ob_index .argsort ()
882882 ob_index = ob_index .take (sorter )
883883 _ , index = np .unique (sorter , return_index = True )
884- na_ids = ob_ids == - 1
885- if not na_ids .all ():
886- ob_ids = np .where (na_ids , - 1 , index .take (ob_ids ))
884+ ob_ids = np .where (ob_ids == - 1 , - 1 , index .take (ob_ids ))
887885 ob_ids = ensure_platform_int (ob_ids )
888886 return ob_index , ob_ids
889887
You can’t perform that action at this time.
0 commit comments