diff --git a/pandas/_libs/groupby.pyx b/pandas/_libs/groupby.pyx index 5a958d5e0bd3c..438d9fa625737 100644 --- a/pandas/_libs/groupby.pyx +++ b/pandas/_libs/groupby.pyx @@ -986,8 +986,8 @@ def group_last(rank_t[:, :] out, def group_nth(rank_t[:, :] out, int64_t[:] counts, ndarray[rank_t, ndim=2] values, - const int64_t[:] labels, int64_t rank=1, - Py_ssize_t min_count=-1): + const int64_t[:] labels, int64_t rank=1 + ): """ Only aggregates on axis=0 """ @@ -998,8 +998,6 @@ def group_nth(rank_t[:, :] out, ndarray[int64_t, ndim=2] nobs bint runtime_error = False - assert min_count == -1, "'min_count' only used in add and prod" - # TODO(cython 3.0): # Instead of `labels.shape[0]` use `len(labels)` if not len(values) == labels.shape[0]: diff --git a/pandas/core/groupby/ops.py b/pandas/core/groupby/ops.py index 438030008bb4d..fc80852f00c95 100644 --- a/pandas/core/groupby/ops.py +++ b/pandas/core/groupby/ops.py @@ -603,8 +603,7 @@ def _aggregate( ): if agg_func is libgroupby.group_nth: # different signature from the others - # TODO: should we be using min_count instead of hard-coding it? - agg_func(result, counts, values, comp_ids, rank=1, min_count=-1) + agg_func(result, counts, values, comp_ids, rank=1) else: agg_func(result, counts, values, comp_ids, min_count)