xarray.Dataset.set_coords

Dataset.set_coords(names, inplace=None)

Given names of one or more variables, set them as coordinates

Parameters:
names : str or list of str

Name(s) of variables in this dataset to convert into coordinates.

inplace : bool, optional

If True, modify this dataset inplace. Otherwise, create a new object.

Returns:
Dataset