# xarray.Dataset.swap_dims

`Dataset.``swap_dims`(dims_dict, inplace=False)

  Returns a new object with swapped dimensions.

  Parameters:

  dims_dict : dict-like

  > Dictionary whose keys are current dimension names and whose values are new names. Each value must already be a variable in the dataset.

  inplace : bool, optional

  > If True, swap dimensions in-place. Otherwise, return a new dataset object.

  Returns:

  renamed : Dataset

  > Dataset with swapped dimensions.

  See also

  `Dataset.rename`, `DataArray.swap_dims`