# xarray.Dataset.to_dataframe

#### Dataset.to_dataframe(dim_order=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataset.py#L7437-L7466)

Convert this dataset into a pandas.DataFrame.

Non-index variables in this dataset form the columns of the
DataFrame. The DataFrame is indexed by the Cartesian product of
this dataset’s indices.

* **Parameters:**
  **dim_order** (`Sequence` of `Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Hierarchical dimension order for the resulting dataframe. All
  arrays are 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 dataset. By
  default, dimensions are in the same order as in Dataset.sizes.
* **Returns:**
  **result** ([`DataFrame`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame)) – Dataset as a pandas DataFrame.
