# xarray.DataArray.rename

#### DataArray.rename(new_name_or_name_dict=None, \*\*names)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataarray.py#L2689-L2731)

Returns a DataArray with renamed coordinates, dimensions or a new name.

* **Parameters:**
  * **new_name_or_name_dict** ([`str`](xarray.DataArray.str.html.md#xarray.DataArray.str) or [dict-like](https://docs.python.org/3/glossary.html#term-mapping), *optional*) – If the argument is dict-like, it used as a mapping from old
    names to new names for coordinates or dimensions. 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 or dimensions.
    One of new_name_or_name_dict or names must be provided.
* **Returns:**
  **renamed** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray)) – Renamed array or array with renamed coordinates.

#### SEE ALSO
[`Dataset.rename`](xarray.Dataset.rename.html.md#xarray.Dataset.rename), [`DataArray.swap_dims`](xarray.DataArray.swap_dims.html.md#xarray.DataArray.swap_dims)
