xarray/core/variable.py
def transpose(self, *dims) -> "Variable":
        """Return a new Variable object with transposed dimensions.

        Parameters
        ----------
        *dims : str, optional
            By default, reverse the dimensions. Otherwise, reorder the
            dimensions to this order.

        Returns
        -------
        transposed : Variable
            The returned object has transposed data and dimensions with the
            same attributes as the original.

        Notes
        -----
        This operation returns a view of this variable's data. It is
        lazy for dask-backed Variables but not for numpy-backed Variables.

        See Also
        --------
        numpy.transpose
        """
        if len(dims) == 0:
            dims = self.dims[::-1]
        dims = tuple(infix_dims(dims, self.dims))
        axes = self.get_axis_num(dims)
        if len(dims) < 2 or dims == self.dims:
            # no need to transpose if only one dimension
            # or dims are in same order
            return self.copy(deep=False)

        data = as_indexable(self._data).transpose(axes)
        return type(self)(dims, data, self._attrs, self._encoding, fastpath=True)
Return a new Variable object with transposed dimensions.

        Parameters
        ----------
        *dims : str, optional
            By default, reverse the dimensions. Otherwise, reorder the
            dimensions to this order.

        Returns
        -------
        transposed : Variable
            The returned object has transposed data and dimensions with the
            same attributes as the original.

        Notes
        -----
        This operation returns a view of this variable's data. It is
        lazy for dask-backed Variables but not for numpy-backed Variables.

        See Also
        --------
        numpy.transpose
        
Return a new Variable object with transposed dimensions.
Parameters

dims : str, optional
By default, reverse the dimensions. Otherwise, reorder the
dimensions to this order.

Returns

transposed : Variable
The returned object has transposed data and dimensions with the
same attributes as the original.

Notes

This operation returns a view of this variable's data. It is
lazy for dask-backed Variables but not for numpy-backed Variables.

See Also


Return a new Variable object with transposed dimensions . Parameters dims : str optional By default reverse the dimensions . Otherwise reorder the dimensions to this order . Returns transposed : Variable The returned object has transposed data and dimensions with the same attributes as the original . Notes This operation returns a view of this variable ' s data . It is lazy for dask - backed Variables but not for numpy - backed Variables . See Also
def transpose(self, *dims) -> "Variable":
        if len(dims) == 0:
            dims = self.dims[::-1]
        dims = tuple(infix_dims(dims, self.dims))
        axes = self.get_axis_num(dims)
        if len(dims) < 2 or dims == self.dims:
            return self.copy(deep=False)
        data = as_indexable(self._data).transpose(axes)
        return type(self)(dims, data, self._attrs, self._encoding, fastpath=True)
def transpose ( self , * dims ) -> "Variable" : if len ( dims ) == 0 : dims = self . dims [ : : - 1 ] dims = tuple ( infix_dims ( dims , self . dims ) ) axes = self . get_axis_num ( dims ) if len ( dims ) < 2 or dims == self . dims : return self . copy ( deep = False ) data = as_indexable ( self . _data ) . transpose ( axes ) return type ( self ) ( dims , data , self . _attrs , self . _encoding , fastpath = True )
Return a new Variable object with transposed dimensions.
Return a new Variable object with transposed dimensions .
"""Return a new Variable object with transposed dimensions.

        Parameters
        ----------
        *dims : str, optional
            By default, reverse the dimensions. Otherwise, reorder the
            dimensions to this order.

        Returns
        -------
        transposed : Variable
            The returned object has transposed data and dimensions with the
            same attributes as the original.

        Notes
        -----
        This operation returns a view of this variable's data. It is
        lazy for dask-backed Variables but not for numpy-backed Variables.

        See Also
        --------
        numpy.transpose
        """ # no need to transpose if only one dimension # or dims are in same order
self