# xarray.DataArray.swap_dims¶

DataArray.swap_dims(dims_dict)

Returns a new DataArray with swapped dimensions.

Parameters
dims_dictdict-like

Dictionary whose keys are current dimension names and whose values are new names. Each value must already be a coordinate on this array.

Returns
renamedDataset

DataArray with swapped dimensions.