xarray.DataArray.pr.to_df#
- DataArray.pr.to_df(name: str | None = None) DataFrame | Series #
Convert this array into an unstacked (i.e. non-tidy) pandas.DataFrame.
Converting to an unstacked
pandas.DataFrame
is most useful for two-dimensional data because then there is no MultiIndex, making the result very easy to read.If you want a tidy dataframe, use
xarray.DataArray.to_dataframe()
instead.- Parameters:
- name: str
Name to give to this array (required if unnamed).
- Returns:
- dfpandas.DataFrame