xarray.Dataset.transpose

Dataset.transpose(*dims) → xarray.core.dataset.Dataset

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:*dims (Hashable, optional) – By default, reverse the dimensions on each array. Otherwise, reorder the dimensions to this order.
Returns:transposed – Each array in the dataset (including) coordinates will be transposed to the given order.
Return type:Dataset

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(), DataArray.transpose()