Skip to content

CLN: Remove counts Argument from Cython GroupBy Aggregations #19778

@WillAyd

Description

@WillAyd

All of the Cython aggregation functions accept counts as their second argument. In theory, it looks as if this parameter could assist in the handling of NaN values within a group, as dictated by the below lines of code:

self._filter_empty_groups and not counts.all():

However, self._filter_empty_groups from what I can tell is always False. The only place this really gets exposed is in the BinGrouper constructor, but that is an internal class and I don't see any invocations of it that override the default value, essentially making the code linked above a noop.

I'm assuming that is part of an abandoned implementation, and if that's the case there's a decent amount of code cleanup / simplification that can be had between groupby.py and groupby_helpers.pxi.in if we remove counts

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanClosing CandidateMay be closeable, needs more eyeballsGroupbyInternalsRelated to non-user accessible pandas implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions