pandas.DataFrame.swapaxes

DataFrame.swapaxes(axis1, axis2, copy=None)[source]

Interchange axes and swap values axes appropriately.

Deprecated since version 2.1.0: swapaxes is deprecated and will be removed. Please use transpose instead.

Returns:
same as input

Examples

Please see examples for DataFrame.transpose().

© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.DataFrame.swapaxes.html