From f06b568971729c1b39b43075a43d22f2a6fc3211 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 9 Mar 2024 14:01:41 -0500 Subject: [PATCH 1/2] Update documentation in dataset.py --- 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..55fd27b4d8e 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 ---------- From b507d44be3ce4db935b9f242773962ef7c004f95 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 19:03:50 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- xarray/core/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 55fd27b4d8e..b4c00b66ed8 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -7266,7 +7266,7 @@ 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). If you rather preserve the MultiIndex use + 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