diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 0fc8b8217b63f..989ef6958d2e6 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -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__ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9084395871675..e0e9048b20a9d 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -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`` is deprecated and will be removed. + Please use ``transpose`` instead. + Returns ------- same as input + + Examples + -------- + Please see examples for :meth:`DataFrame.transpose`. """ warnings.warn( # GH#51946