to_pandas

UnitsAwareDataArray.to_pandas() Self | pd.Series | pd.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.

Returns:

result – DataArray, pandas Series or pandas DataFrame.

Return type:

DataArray | Series | DataFrame