File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -744,21 +744,17 @@ def group_sum(
744744 for j in range (K):
745745 val = values[i, j]
746746
747- if not skipna and (
748- (uses_mask and result_mask[lab, j]) or
749- (is_datetimelike and sumx[lab, j] == NPY_NAT) or
750- _treat_as_na(sumx[lab, j], False )
751- ):
752- # If sum is already NA, don't add to it. This is important for
753- # datetimelikebecause adding a value to NPY_NAT may not result
754- # in a NPY_NAT
755- continue
756-
757747 if uses_mask:
758748 isna_entry = mask[i, j]
759749 else :
760750 isna_entry = _treat_as_na(val, is_datetimelike)
761751
752+ if not skipna and isna_entry:
753+ # If sum is already NA, don't add to it. This is important for
754+ # datetimelikebecause adding a value to NPY_NAT may not result
755+ # in a NPY_NAT
756+ continue
757+
762758 if not isna_entry:
763759 nobs[lab, j] += 1
764760
You can’t perform that action at this time.
0 commit comments