# xarray.Index.rename

#### Index.rename(name_dict, dims_dict)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/indexes.py#L419-L448)

Maybe update the index with new coordinate and dimension names.

This method should be re-implemented in subclasses of Index if it has
attributes that depend on coordinate or dimension names.

By default (if not re-implemented), it returns the index itself.

Warning: the input names are not filtered for this method, they may
correspond to any variable or dimension of a Dataset or a DataArray.

* **Parameters:**
  * **name_dict** ([dict-like](https://docs.python.org/3/glossary.html#term-mapping)) – Mapping of current variable or coordinate names to the desired names,
    as passed from [`Dataset.rename_vars()`](xarray.Dataset.rename_vars.html.md#xarray.Dataset.rename_vars).
  * **dims_dict** ([dict-like](https://docs.python.org/3/glossary.html#term-mapping)) – Mapping of current dimension names to the desired names, as passed
    from [`Dataset.rename_dims()`](xarray.Dataset.rename_dims.html.md#xarray.Dataset.rename_dims).
* **Returns:**
  **renamed** ([`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index)) – Index with renamed attributes.
