DataArray.to_dataset(dim=None, name=None)

Convert a DataArray to a Dataset.


dim : str, optional

Name of the dimension on this array along which to split this array into separate variables. If not provided, this array is converted into a Dataset of one variable.

name : str, optional

Name to substitute for this array’s name. Only valid is dim is not provided.


dataset : Dataset