Skip to content

Commit 52c1817

Browse files
committed
TST: don't use Py_ssize_t in the buffer for now
1 parent 0685472 commit 52c1817

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pandas/core/groupby.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,8 @@ def slicer(data, slob):
13581358
def slicer(data, slob):
13591359
return data[slob]
13601360

1361-
starts, ends = lib.generate_slices(group_index, np.prod(shape))
1361+
starts, ends = lib.generate_slices(group_index.astype('i4'),
1362+
np.prod(shape))
13621363

13631364
for i, (start, end) in enumerate(zip(starts, ends)):
13641365
if start == end:

pandas/src/groupby.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def duplicated(list values, take_last=False):
513513
return result.view(np.bool_)
514514

515515

516-
def generate_slices(ndarray[Py_ssize_t] labels, Py_ssize_t ngroups):
516+
def generate_slices(ndarray[int32_t] labels, Py_ssize_t ngroups):
517517
cdef:
518518
Py_ssize_t i, group_size, n, lab, start
519519
object slobj

0 commit comments

Comments
 (0)