Skip to content

DOC: Signature information for groupby.aggregate does not include Named Aggregation #47974

@DRudel

Description

@DRudel
Contributor

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.core.groupby.DataFrameGroupBy.aggregate.html?highlight=aggregate#pandas.core.groupby.DataFrameGroupBy.aggregate

Documentation problem

The entry for Groupby.Aggregate() describes Named Aggregation at the bottom of its entry, but this support is now exposed in the signature information defining the inputs at the top of the page. Also, I would claim that the description for **kwargs is now outdated, for **kwargs now serves a different role when func is None.

Notably, someone looking at signature information would think that Aggregate() and Transform() can take the same types of input, but that is not true, since Transform() does not support Named Aggregation.

Suggested fix for documentation

  • Add a note to the func signature description indicating that when func == None, the Named Aggregation is assumed (with a reference to the User Guide page)
  • Update the **kwargs signature to indicate that when func == None, the keywords are not passed along to the function but are used to define the Named Aggregation

Activity

added
Needs TriageIssue that has not been reviewed by a pandas team member
on Aug 4, 2022
phofl

phofl commented on Aug 20, 2022

@phofl
Member

Hi, thanks for your report. Would you be interested in submitting a pr?

added and removed
Needs TriageIssue that has not been reviewed by a pandas team member
on Aug 20, 2022
DRudel

DRudel commented on Aug 21, 2022

@DRudel
ContributorAuthor

I've never done one before, but sure I'd be willing to give it a try.

added this to the 1.6 milestone on Sep 25, 2022
modified the milestones: 1.6, 2.0 on Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Participants

      @DRudel@mroeschke@rhshadrach@phofl

      Issue actions

        DOC: Signature information for groupby.aggregate does not include Named Aggregation · Issue #47974 · pandas-dev/pandas