DataArray.set_index(append=False, inplace=False, **indexes)

Set DataArray (multi-)indexes using one or more existing coordinates.


append : bool, optional

If True, append the supplied index(es) to the existing index(es). Otherwise replace the existing index(es) (default).

inplace : bool, optional

If True, set new index(es) in-place. Otherwise, return a new DataArray object.

**indexes : {dim: index, …}

Keyword arguments with names matching dimensions and values given by (lists of) the names of existing coordinates or variables to set as new (multi-)index.


obj : DataArray

Another dataarray, with this data but replaced coordinates.