xarray.Dataset.to_array#

Dataset.to_array(dim='variable', name=None)[source]#

Convert this dataset into an xarray.DataArray

The data variables of this dataset will be broadcast against each other and stacked along the first axis of the new array. All coordinates of this dataset will remain coordinates.

Parameters
  • dim (Hashable, default: "variable") – Name of the new dimension.

  • name (Hashable or None, optional) – Name of the new data array.

Returns

array (xarray.DataArray)