# xarray.Dataset.transpose

#### Dataset.transpose(\*dim, missing_dims='raise')[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataset.py#L6338-L6393)

Return a new Dataset object with all array dimensions transposed.

Although the order of dimensions on each array will change, the dataset
dimensions themselves will remain in fixed (sorted) order.

* **Parameters:**
  * **\*dim** ([hashable](../user-guide/terminology.html.md#term-name), *optional*) – By default, reverse the dimensions on each array. Otherwise,
    reorder the dimensions to this order.
  * **missing_dims** (`{"raise", "warn", "ignore"}`, *default*: `"raise"`) – What to do if dimensions that should be selected from are not present in the
    Dataset:
    - “raise”: raise an exception
    - “warn”: raise a warning, and ignore the missing dimensions
    - “ignore”: ignore the missing dimensions
* **Returns:**
  **transposed** ([`Dataset`](xarray.Dataset.html.md#xarray.Dataset)) – Each array in the dataset (including) coordinates will be
  transposed to the given order.

### Notes

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

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