xarray.DataArray.to_pandas

DataArray.to_pandas()

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

  • 3D -> pandas.Panel (deprecated)

Only works for arrays with 3 or fewer dimensions.

The DataArray constructor performs the inverse transformation.