pyspark.pandas.Series.swapaxesΒΆ
-
Series.
swapaxes
(i: Union[int, str], j: Union[int, str], copy: bool = True) β pyspark.pandas.series.Series[source]ΒΆ Interchange axes and swap values axes appropriately.
- 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