10BC0 BUG: incorrect rounding in groupby.cummin near int64 implementation bounds by jbrockmendel · Pull Request #40767 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content
Prev Previous commit
Next Next commit
comment+GH ref
  • Loading branch information
jbrockmendel committed Apr 12, 2021
commit e5cf34d2201f8125354726e16818639d80a3c749
4 changes: 3 additions & 1 deletion pandas/core/groupby/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,9 @@ def _cython_operation(
func(result, values, comp_ids, ngroups, is_datetimelike, **kwargs)

if kind == "aggregate":
# i.e. counts is defined
# i.e. counts is defined. Locations where count<min_count
# need to have the result set to np.nan, which may require casting,
# see GH#40767
if is_integer_dtype(result.dtype) and not is_datetimelike:
cutoff = max(1, min_count)
empty_groups = counts < cutoff
Expand Down
0