@@ -1793,13 +1793,13 @@ def indices(self):
1793
1793
@cache_readonly
1794
1794
def group_info (self ):
1795
1795
ngroups = self .ngroups
1796
- obs_group_ids = np .arange (ngroups )
1796
+ obs_group_ids = np .arange (ngroups , dtype = 'int64' )
1797
1797
rep = np .diff (np .r_ [0 , self .bins ])
1798
1798
1799
1799
if ngroups == len (self .bins ):
1800
- comp_ids = np .repeat (np .arange (ngroups ), rep )
1800
+ comp_ids = np .repeat (np .arange (ngroups , dtype = 'int64' ), rep )
1801
1801
else :
1802
- comp_ids = np .repeat (np .r_ [- 1 , np .arange (ngroups )], rep )
1802
+ comp_ids = np .repeat (np .r_ [- 1 , np .arange (ngroups , dtype = 'int64' )], rep )
1803
1803
1804
1804
return comp_ids , obs_group_ids , ngroups
1805
1805
@@ -2552,8 +2552,8 @@ def nunique(self, dropna=True):
2552
2552
2553
2553
# group boundries are where group ids change
2554
2554
# unique observations are where sorted values change
2555
- idx = np .r_ [0 , 1 + np .nonzero (ids [1 :] != ids [:- 1 ])[0 ]]
2556
- inc = np .r_ [1 , val [1 :] != val [:- 1 ]]
2555
+ idx = com . _ensure_int64 ( np .r_ [0 , 1 + np .nonzero (ids [1 :] != ids [:- 1 ])[0 ]])
2556
+ inc = com . _ensure_int64 ( np .r_ [1 , val [1 :] != val [:- 1 ]])
2557
2557
2558
2558
# 1st item of each group is a new unique observation
2559
2559
mask = isnull (val )
0 commit comments