pyspark.pandas.Series.swapaxes#

Series.swapaxes(i, j, copy=True)[source]#

Interchange axes and swap values axes appropriately.

Deprecated since version 4.0.0.

Parameters
i: {0 or ‘index’, 1 or ‘columns’}. The axis to swap.
j: {0 or ‘index’, 1 or ‘columns’}. The axis to swap.
copybool, default True.
Returns
Series

Examples

>>> psser = ps.Series([1, 2, 3], index=["x", "y", "z"])
>>> psser
x    1
y    2
z    3
dtype: int64
>>>
>>> psser.swapaxes(0, 0)
x    1
y    2
z    3
dtype: int64