🍾 Xarray is now 10 years old! 🎉

xarray.Dataset.to_dask_dataframe

xarray.Dataset.to_dask_dataframe#

Dataset.to_dask_dataframe(dim_order=None, set_index=False)[source]#

Convert this dataset into a dask.dataframe.DataFrame.

The dimensions, coordinates and data variables in this dataset form the columns of the DataFrame.

Parameters:
  • dim_order (list, 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 dask dataframe.

    If provided, must include all dimensions of this dataset. By default, dimensions are sorted alphabetically.

  • set_index (bool, default: False) – If set_index=True, the dask DataFrame is indexed by this dataset’s coordinate. Since dask DataFrames do not support multi-indexes, set_index only works if the dataset only contains one dimension.

Returns:

dask.dataframe.DataFrame