Skip to content

Commit c4f6588

Browse files
authored
CLN: remove unused min_count argument in libgroupby.group_nth (#37747)
1 parent 500a7dc commit c4f6588

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pandas/_libs/groupby.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,8 @@ def group_last(rank_t[:, :] out,
986986
def group_nth(rank_t[:, :] out,
987987
int64_t[:] counts,
988988
ndarray[rank_t, ndim=2] values,
989-
const int64_t[:] labels, int64_t rank=1,
990-
Py_ssize_t min_count=-1):
989+
const int64_t[:] labels, int64_t rank=1
990+
):
991991
"""
992992
Only aggregates on axis=0
993993
"""
@@ -998,8 +998,6 @@ def group_nth(rank_t[:, :] out,
998998
ndarray[int64_t, ndim=2] nobs
999999
bint runtime_error = False
10001000

1001-
assert min_count == -1, "'min_count' only used in add and prod"
1002-
10031001
# TODO(cython 3.0):
10041002
# Instead of `labels.shape[0]` use `len(labels)`
10051003
if not len(values) == labels.shape[0]:

pandas/core/groupby/ops.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,7 @@ def _aggregate(
603603
):
604604
if agg_func is libgroupby.group_nth:
605605
# different signature from the others
606-
# TODO: should we be using min_count instead of hard-coding it?
607-
agg_func(result, counts, values, comp_ids, rank=1, min_count=-1)
606+
agg_func(result, counts, values, comp_ids, rank=1)
608607
else:
609608
agg_func(result, counts, values, comp_ids, min_count)
610609

0 commit comments

Comments
 (0)