Skip to content

Commit

Permalink
PREF: Fix regression from #58984 (#59025)
Browse files Browse the repository at this point in the history
* check uses_mask before

* backup gh

* backup gh
  • Loading branch information
luke396 committed Jun 17, 2024
1 parent b7970fc commit 5d451fe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pandas/_libs/groupby.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,12 @@ def group_cumsum(
for i in range(N):
lab = labels[i]

if lab < 0:
if uses_mask and lab < 0:
# GH#58811
if uses_mask:
result_mask[i, :] = True
out[i, :] = 0
result_mask[i, :] = True
out[i, :] = 0
continue
elif lab < 0:
continue

for j in range(K):
Expand Down

0 comments on commit 5d451fe

Please sign in to comment.