DataArray.transpose(*dims, transpose_coords=True, missing_dims='raise')[source]#

Return a new DataArray object with transposed dimensions.

  • *dims (Hashable, optional) – By default, reverse the dimensions. Otherwise, reorder the dimensions to this order.

  • transpose_coords (bool, default: 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


transposed (DataArray) – The returned DataArray’s array is transposed.


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.