@@ -1793,13 +1793,13 @@ def indices(self):
17931793 @cache_readonly
17941794 def group_info (self ):
17951795 ngroups = self .ngroups
1796- obs_group_ids = np .arange (ngroups )
1796+ obs_group_ids = np .arange (ngroups , dtype = 'int64' )
17971797 rep = np .diff (np .r_ [0 , self .bins ])
17981798
17991799 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 )
18011801 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 )
18031803
18041804 return comp_ids , obs_group_ids , ngroups
18051805
@@ -2552,8 +2552,8 @@ def nunique(self, dropna=True):
25522552
25532553 # group boundries are where group ids change
25542554 # 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 ]])
25572557
25582558 # 1st item of each group is a new unique observation
25592559 mask = isnull (val )
0 commit comments