From c919739fe6b2cdd46887dda90dcc50cb22996fe5 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 9 Mar 2024 17:33:16 -0500 Subject: [PATCH] Update documentation for clarity (#8817) * Update documentation in dataset.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- xarray/core/dataset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index bdb881278eb..b4c00b66ed8 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -7266,10 +7266,11 @@ def from_dataframe(cls, dataframe: pd.DataFrame, sparse: bool = False) -> Self: Each column will be converted into an independent variable in the Dataset. If the dataframe's index is a MultiIndex, it will be expanded into a tensor product of one-dimensional indices (filling in missing - values with NaN). This method will produce a Dataset very similar to + values with NaN). If you rather preserve the MultiIndex use + `xr.Dataset(df)`. This method will produce a Dataset very similar to that on which the 'to_dataframe' method was called, except with possibly redundant dimensions (since all dataset variables will have - the same dimensionality) + the same dimensionality). Parameters ----------