Skip to content

Commit a1444c9

Browse files
committed
Use _get_na_val to determine nan_val in group_prod
1 parent 574708e commit a1444c9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pandas/_libs/groupby.pyx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -831,13 +831,7 @@ def group_prod(
831831
prodx = np.ones((<object>out).shape, dtype=(<object>out).base.dtype)
832832

833833
N, K = (<object>values).shape
834-
if uses_mask:
835-
nan_val = 0
836-
elif int64float_t is int64_t or int64float_t is uint64_t:
837-
# This has no effect as int64 can't be nan. Setting to 0 to avoid type error
838-
nan_val = 0
839-
else:
840-
nan_val = NAN
834+
nan_val = _get_na_val(<int64float_t>0, False)
841835

842836
with nogil:
843837
for i in range(N):

0 commit comments

Comments
 (0)