xarray.DataArray.to_pandas

DataArray.to_pandas()[source]

Convert this array into a pandas object with the same shape.

The type of the returned object depends on the number of DataArray dimensions:

  • 0D -> xarray.DataArray

  • 1D -> pandas.Series

  • 2D -> pandas.DataFrame

Only works for arrays with 2 or fewer dimensions.

The DataArray constructor performs the inverse transformation.