# xarray.DataArray.transpose

#### DataArray.transpose(\*dim, transpose_coords=True, missing_dims='raise')[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataarray.py#L3252-L3301)

Return a new DataArray object with transposed dimensions.

* **Parameters:**
  * **\*dim** (`Hashable`, *optional*) – By default, reverse the dimensions. Otherwise, reorder the
    dimensions to this order.
  * **transpose_coords** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *default*: [`True`](https://docs.python.org/3/builtins/constants.html#True)) – If True, also transpose the coordinates of this DataArray.
  * **missing_dims** (`{"raise", "warn", "ignore"}`, *default*: `"raise"`) – What to do if dimensions that should be selected from are not present in the
    DataArray:
    - “raise”: raise an exception
    - “warn”: raise a warning, and ignore the missing dimensions
    - “ignore”: ignore the missing dimensions
* **Returns:**
  **transposed** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray)) – The returned DataArray’s array is transposed.

### Notes

This operation returns a view of this array’s data. It is
lazy for dask-backed DataArrays but not for numpy-backed DataArrays
– the data will be fully loaded.

#### SEE ALSO
[`numpy.transpose`](https://numpy.org/doc/stable/reference/generated/numpy.transpose.html#numpy.transpose), [`Dataset.transpose`](xarray.Dataset.transpose.html.md#xarray.Dataset.transpose)
