DataArray.to_pandas(self) → Union[ForwardRef('DataArray'), pandas.core.series.Series, pandas.core.frame.DataFrame]

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.