- DataArray.to_dataframe(name=None, dim_order=None)[source]#
Convert this array and its coordinates into a tidy pandas.DataFrame.
The DataFrame is indexed by the Cartesian product of index coordinates (in the form of a
pandas.MultiIndex). Other coordinates are included as columns in the DataFrame.
For 1D and 2D DataArrays, see also
DataArray.to_pandas()which doesn’t rely on a MultiIndex to build the DataFrame.
None, optional) – Name to give to this array (required if unnamed).
None, optional) – Hierarchical dimension order for the resulting dataframe. Array content is transposed to this order and then written out as flat vectors in contiguous order, so the last dimension in this list will be contiguous in the resulting DataFrame. This has a major influence on which operations are efficient on the resulting dataframe.
If provided, must include all dimensions of this DataArray. By default, dimensions are sorted according to the DataArray dimensions order.
DataFrame) – DataArray as a pandas DataFrame.