@@ -762,7 +762,7 @@ def ids(self) -> np.ndarray:
762
762
@cache_readonly
763
763
def result_index_and_ids (self ) -> tuple [Index , np .ndarray ]:
764
764
names = self .names
765
- codes = [ping .codes for ping in self .groupings ]
765
+ codes = [ensure_platform_int ( ping .codes ) for ping in self .groupings ]
766
766
levels = [Index ._with_infer (ping .uniques ) for ping in self .groupings ]
767
767
obs = [
768
768
ping ._observed or not ping ._passed_categorical for ping in self .groupings
@@ -775,7 +775,7 @@ def result_index_and_ids(self) -> tuple[Index, np.ndarray]:
775
775
if len (self .groupings ) == 1 :
776
776
result_index = levels [0 ]
777
777
result_index .name = names [0 ]
778
- ids = codes [0 ]. astype ( "intp" , copy = False )
778
+ ids = codes [0 ]
779
779
return result_index , ids
780
780
781
781
if any (obs ):
@@ -786,7 +786,6 @@ def result_index_and_ids(self) -> tuple[Index, np.ndarray]:
786
786
shape = tuple (len (level ) for level in ob_levels )
787
787
group_index = get_group_index (ob_codes , shape , sort = True , xnull = True )
788
788
ob_ids , obs_group_ids = compress_group_index (group_index , sort = self ._sort )
789
- ob_ids = ensure_platform_int (ob_ids )
790
789
ob_index_codes = decons_obs_group_ids (
791
790
ob_ids , obs_group_ids , shape , ob_codes , xnull = True
792
791
)
@@ -804,7 +803,6 @@ def result_index_and_ids(self) -> tuple[Index, np.ndarray]:
804
803
805
804
shape = tuple (len (level ) for level in unob_levels )
806
805
unob_ids = get_group_index (unob_codes , shape , sort = True , xnull = True )
807
- unob_ids = ensure_platform_int (unob_ids )
808
806
unob_index = MultiIndex .from_product (unob_levels , names = unob_names )
809
807
810
808
if all (obs ):
0 commit comments