xarray.Index.rename#
- Index.rename(name_dict, dims_dict)[source]#
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) – Mapping of current variable or coordinate names to the desired names, as passed from
Dataset.rename_vars()
.dims_dict (dict-like) – Mapping of current dimension names to the desired names, as passed from
Dataset.rename_dims()
.
- Returns
renamed (
Index
) – Index with renamed attributes.