Skip to content

Commit e654b81

Browse files
WillAydharisbal
authored and
harisbal
committed
GroupBy Rank SegFault Fix - astype instead of view (pandas-dev#19701)
* Use astype instead of view for lexsort upcasting * Added copy=False to astype in group_rank
1 parent 408773d commit e654b81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/_libs/groupby_helper.pxi.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def group_rank_{{name}}(ndarray[float64_t, ndim=2] out,
531531
# each label corresponds to a different group value,
532532
# the mask helps you differentiate missing values before
533533
# performing sort on the actual values
534-
_as = np.lexsort(order).view(dtype=np.int64)
534+
_as = np.lexsort(order).astype(np.int64, copy=False)
535535

536536
if not ascending:
537537
_as = _as[::-1]

0 commit comments

Comments
 (0)