-
-
Notifications
You must be signed in to change notification settings - Fork 19.6k
DOC: Add User Guide links to GroupBy aggregate, transform, and apply methods #63837
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
base: main
Are you sure you want to change the base?
DOC: Add User Guide links to GroupBy aggregate, transform, and apply methods #63837
Conversation
…methods Add cross-references to the User Guide in the See Also sections of: - SeriesGroupBy.aggregate - DataFrameGroupBy.aggregate - transform (via _transform_template) - GroupBy.apply This helps users discover the relevant User Guide sections when using the API reference. Closes pandas-dev#62357
Move :ref: directives from See Also section to Notes section because numpydoc does not support :ref: in See Also entries.
rhshadrach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
pandas/core/groupby/groupby.py
Outdated
| Notes | ||
| ----- | ||
| See :ref:`groupby.transform` in the User Guide for more details and examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This transform template appears no longer used. Can you update the two methods transform in generic.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can also remove this template I think; but that can also be done in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, Thanks for letting me know
| Notes | ||
| ----- | ||
| See :ref:`groupby.apply` in the User Guide for more details and examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add this line to SeriesGroupBy.apply in generic.py.
- Remove link from _transform_template (no longer used) - Add link to SeriesGroupBy.apply - Add link to SeriesGroupBy.transform - Add link to DataFrameGroupBy.transform
Description
This PR adds cross-references from the GroupBy API documentation back to the User Guide, addressing #62357.
Changes
Added
:ref:links to the User Guide in theSee Alsosections of:SeriesGroupBy.aggregategroupby.aggregateDataFrameGroupBy.aggregategroupby.aggregatetransform(via_transform_template)groupby.transformGroupBy.applygroupby.applyAlso added a note in the API reference (
doc/source/reference/groupby.rst) with links to relevant User Guide sections.Motivation
As noted in the issue, users navigating from the User Guide to API docs couldn't easily navigate back. This improves discoverability of the comprehensive User Guide sections on groupby operations.
Files Changed
pandas/core/groupby/generic.py- Added User Guide links to aggregate docstringspandas/core/groupby/groupby.py- Added User Guide links to apply and transform docstringsdoc/source/reference/groupby.rst- Added User Guide references in Function application sectionCloses #62357