xarray.DataArray.rename¶
-
DataArray.
rename
(new_name_or_name_dict: Union[Hashable, Mapping[Hashable, Hashable], None] = None, **names) → xarray.core.dataarray.DataArray¶ Returns a new DataArray with renamed coordinates or a new name.
- Parameters
- new_name_or_name_dictstr or dict-like, optional
If the argument is dict-like, it used as a mapping from old names to new names for coordinates. Otherwise, use the argument as the new name for this array.
- **names: hashable, optional
The keyword arguments form of a mapping from old names to new names for coordinates. One of new_name_or_name_dict or names must be provided.
- Returns
- renamedDataArray
Renamed array or array with renamed coordinates.
See also