File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 24
24
)
25
25
import pandas ._libs .groupby as libgroupby
26
26
from pandas ._typing import (
27
- AnyArrayLike ,
28
27
ArrayLike ,
29
28
AxisInt ,
30
29
NDFrameT ,
@@ -767,7 +766,7 @@ def result_index_and_ids(self) -> tuple[Index, np.ndarray]:
767
766
768
767
codes_and_uniques = [ping ._codes_and_uniques for ping in self .groupings ]
769
768
770
- codes = [e [0 ] for e in codes_and_uniques ]
769
+ codes = [e [0 ]. astype ( "intp" , copy = False ) for e in codes_and_uniques ]
771
770
levels = [Index ._with_infer (e [1 ]) for e in codes_and_uniques ]
772
771
for k , (ping , level ) in enumerate (zip (self .groupings , levels )):
773
772
if ping ._passed_categorical :
@@ -780,9 +779,9 @@ def result_index_and_ids(self) -> tuple[Index, np.ndarray]:
780
779
]
781
780
782
781
if len (self .groupings ) == 1 :
783
- result_index : AnyArrayLike = levels [0 ]
782
+ result_index = levels [0 ]
784
783
result_index .name = names [0 ]
785
- ids = codes [0 ]. astype ( "intp" )
784
+ ids = codes [0 ]
786
785
return result_index , ids
787
786
elif any (obs ):
788
787
ob_codes = [e for e , o in zip (codes , obs ) if o ]
You can’t perform that action at this time.
0 commit comments