Skip to content

Commit c46a09e

Browse files
committed
changes made to pandas/core/groupby/ops.py/_call_cython_ops() and new file added in pandas/tests/groupby/test_groupby_last.py, issue pandas-dev#46409
1 parent 073b353 commit c46a09e

File tree

2 files changed

+1296
-0
lines changed

2 files changed

+1296
-0
lines changed

pandas/core/groupby/ops.py

+5
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,11 @@ def _call_cython_op(
577577
**kwargs,
578578
)
579579

580+
if self.how == 'last' and dtype == bool:
581+
for val in result:
582+
if val > 1 or val < 0:
583+
result = values
584+
580585
if self.kind == "aggregate":
581586
# i.e. counts is defined. Locations where count<min_count
582587
# need to have the result set to np.nan, which may require casting,

0 commit comments

Comments
 (0)