Skip to content

Commit 1907b35

Browse files
committed
fix issue #59712
1 parent 80b6850 commit 1907b35

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/core/groupby/ops.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,6 @@ def _call_cython_op(
371371

372372
is_datetimelike = dtype.kind in "mM"
373373

374-
if is_datetimelike:
375-
values = values.view("int64")
376-
is_numeric = True
377-
elif dtype.kind == "b":
378-
values = values.view("uint8")
379-
if values.dtype == "float16":
380-
values = values.astype(np.float32)
381-
382374
if self.how in ["any", "all"]:
383375
if mask is None:
384376
mask = isna(values)
@@ -392,6 +384,14 @@ def _call_cython_op(
392384
values = values.astype(bool, copy=False).view(np.int8)
393385
is_numeric = True
394386

387+
if is_datetimelike:
388+
values = values.view("int64")
389+
is_numeric = True
390+
elif dtype.kind == "b":
391+
values = values.view("uint8")
392+
if values.dtype == "float16":
393+
values = values.astype(np.float32)
394+
395395
values = values.T
396396
if mask is not None:
397397
mask = mask.T

0 commit comments

Comments
 (0)