def swapaxes(self, i: Axis, j: Axis, copy: bool=True) -> 'DataFrame':
    "\n        Interchange axes and swap values axes appropriately.\n\n        .. note:: This method is based on an expensive operation due to the nature\n            of big data. Internally it needs to generate each row for each value, and\n            then group twice - it is a huge operation. To prevent misusage, this method\n            has the 'compute.max_rows' default limit of input length, and raises a ValueError.\n\n                >>> from pyspark.pandas.config import option_context\n                >>> with option_context('compute.max_rows', 1000):  # doctest: +NORMALIZE_WHITESPACE\n                ...     ps.DataFrame({'a': range(1001)}).swapaxes(i=0, j=1)\n                Traceback (most recent call last):\n                  ...\n                ValueError: Current DataFrame has more then the given limit 1000 rows.\n                Please set 'compute.max_rows' by using 'pyspark.pandas.config.set_option'\n                to retrieve to retrieve more than 1000 rows. Note that, before changing the\n                'compute.max_rows', this operation is considerably expensive.\n\n        Parameters\n        ----------\n        i: {0 or 'index', 1 or 'columns'}. The axis to swap.\n        j: {0 or 'index', 1 or 'columns'}. The axis to swap.\n        copy : bool, default True.\n\n        Returns\n        -------\n        DataFrame\n\n        Examples\n        --------\n        >>> psdf = ps.DataFrame(\n        ...     [[1, 2, 3], [4, 5, 6], [7, 8, 9]], index=['x', 'y', 'z'], columns=['a', 'b', 'c']\n        ... )\n        >>> psdf\n           a  b  c\n        x  1  2  3\n        y  4  5  6\n        z  7  8  9\n        >>> psdf.swapaxes(i=1, j=0)\n           x  y  z\n        a  1  4  7\n        b  2  5  8\n        c  3  6  9\n        >>> psdf.swapaxes(i=1, j=1)\n           a  b  c\n        x  1  2  3\n        y  4  5  6\n        z  7  8  9\n        "
    assert (copy is True)
    i = validate_axis(i)
    j = validate_axis(j)
    return (self.copy() if (i == j) else self.transpose())
Interchange axes and swap values axes appropriately.

.. note:: This method is based on an expensive operation due to the nature
    of big data. Internally it needs to generate each row for each value, and
    then group twice - it is a huge operation. To prevent misusage, this method
    has the 'compute.max_rows' default limit of input length, and raises a ValueError.

        >>> from pyspark.pandas.config import option_context
        >>> with option_context('compute.max_rows', 1000):  # doctest: +NORMALIZE_WHITESPACE
        ...     ps.DataFrame({'a': range(1001)}).swapaxes(i=0, j=1)
        Traceback (most recent call last):
          ...
        ValueError: Current DataFrame has more then the given limit 1000 rows.
        Please set 'compute.max_rows' by using 'pyspark.pandas.config.set_option'
        to retrieve to retrieve more than 1000 rows. Note that, before changing the
        'compute.max_rows', this operation is considerably expensive.

Parameters
----------
i: {0 or 'index', 1 or 'columns'}. The axis to swap.
j: {0 or 'index', 1 or 'columns'}. The axis to swap.
copy : bool, default True.

Returns
-------
DataFrame

Examples
--------
>>> psdf = ps.DataFrame(
...     [[1, 2, 3], [4, 5, 6], [7, 8, 9]], index=['x', 'y', 'z'], columns=['a', 'b', 'c']
... )
>>> psdf
   a  b  c
x  1  2  3
y  4  5  6
z  7  8  9
>>> psdf.swapaxes(i=1, j=0)
   x  y  z
a  1  4  7
b  2  5  8
c  3  6  9
>>> psdf.swapaxes(i=1, j=1)
   a  b  c
x  1  2  3
y  4  5  6
z  7  8  9
def swapaxes(self, i: Axis, j: Axis, copy: bool=True) -> 'DataFrame':
    "\n        Interchange axes and swap values axes appropriately.\n\n        .. note:: This method is based on an expensive operation due to the nature\n            of big data. Internally it needs to generate each row for each value, and\n            then group twice - it is a huge operation. To prevent misusage, this method\n            has the 'compute.max_rows' default limit of input length, and raises a ValueError.\n\n                >>> from pyspark.pandas.config import option_context\n                >>> with option_context('compute.max_rows', 1000):  # doctest: +NORMALIZE_WHITESPACE\n                ...     ps.DataFrame({'a': range(1001)}).swapaxes(i=0, j=1)\n                Traceback (most recent call last):\n                  ...\n                ValueError: Current DataFrame has more then the given limit 1000 rows.\n                Please set 'compute.max_rows' by using 'pyspark.pandas.config.set_option'\n                to retrieve to retrieve more than 1000 rows. Note that, before changing the\n                'compute.max_rows', this operation is considerably expensive.\n\n        Parameters\n        ----------\n        i: {0 or 'index', 1 or 'columns'}. The axis to swap.\n        j: {0 or 'index', 1 or 'columns'}. The axis to swap.\n        copy : bool, default True.\n\n        Returns\n        -------\n        DataFrame\n\n        Examples\n        --------\n        >>> psdf = ps.DataFrame(\n        ...     [[1, 2, 3], [4, 5, 6], [7, 8, 9]], index=['x', 'y', 'z'], columns=['a', 'b', 'c']\n        ... )\n        >>> psdf\n           a  b  c\n        x  1  2  3\n        y  4  5  6\n        z  7  8  9\n        >>> psdf.swapaxes(i=1, j=0)\n           x  y  z\n        a  1  4  7\n        b  2  5  8\n        c  3  6  9\n        >>> psdf.swapaxes(i=1, j=1)\n           a  b  c\n        x  1  2  3\n        y  4  5  6\n        z  7  8  9\n        "
    assert (copy is True)
    i = validate_axis(i)
    j = validate_axis(j)
    return (self.copy() if (i == j) else self.transpose())