Pandas version checks
- [X] 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
Comment From: phofl
Hi, thanks for your report. Would you be interested in submitting a pr?
Comment From: DRudel
I've never done one before, but sure I'd be willing to give it a try.