# xarray.Dataset.to_array

`Dataset.``to_array`(dim='variable', name=None)

  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 (str, optional) – Name of the new dimension.
  - name (str, optional) – Name of the new data array.

  Returns: | array
  Return type: | xarray.DataArray