xarray.Dataset.set_index¶
-
Dataset.
set_index
(append=False, inplace=False, **indexes)¶ Set Dataset (multi-)indexes using one or more existing coordinates or variables.
Parameters: 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 Dataset 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.
Returns: obj : Dataset
Another dataset, with this dataset’s data but replaced coordinates.
See also