Skip to content

DOC: Added depr note to swapaxes docstrings #54125

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

Merged
merged 2 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.api.extensions.ExtensionArray.shape \
pandas.api.extensions.ExtensionArray.tolist \
pandas.DataFrame.pad \
pandas.DataFrame.swapaxes \
pandas.DataFrame.plot \
pandas.DataFrame.to_gbq \
pandas.DataFrame.__dataframe__
Expand Down
8 changes: 8 additions & 0 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,17 @@ def swapaxes(self, axis1: Axis, axis2: Axis, copy: bool_t | None = None) -> Self
"""
Interchange axes and swap values axes appropriately.

.. deprecated:: 2.1.0
``swapaxes`` will be deprecated.
Please use ``transpose`` instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is deprecated - can we say "will be removed"?

also, the indentation looks like it has an extra level (should just be 4 spaces?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


Returns
-------
same as input

Examples
--------
Please see examples for :meth:`DataFrame.transpose`.
"""
warnings.warn(
# GH#51946
Expand Down