Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
DRudel opened this issue Aug 4, 2022 · 2 comments · Fixed by #48613
Closed
1 task done

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

DRudel opened this issue Aug 4, 2022 · 2 comments · Fixed by #48613
Milestone

Comments

@DRudel
Copy link
Contributor

DRudel commented Aug 4, 2022

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
@DRudel DRudel added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 4, 2022
@phofl
Copy link
Member

phofl commented Aug 20, 2022

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

@phofl phofl added Groupby and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 20, 2022
@DRudel
Copy link
Contributor Author

DRudel commented Aug 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants