Skip to content

Conversation

@chaitanyakumar-d
Copy link

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 the See Also sections of:

Method User Guide Link
SeriesGroupBy.aggregate groupby.aggregate
DataFrameGroupBy.aggregate groupby.aggregate
transform (via _transform_template) groupby.transform
GroupBy.apply groupby.apply

Also 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 docstrings
  • pandas/core/groupby/groupby.py - Added User Guide links to apply and transform docstrings
  • doc/source/reference/groupby.rst - Added User Guide references in Function application section

Closes #62357

…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.
Copy link
Member

@rhshadrach rhshadrach left a 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!

Notes
-----
See :ref:`groupby.transform` in the User Guide for more details and examples.
Copy link
Member

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.

Copy link
Member

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.

Copy link
Author

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.
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: Ensure guides are linked from relevant API docs

2 participants