From a97801eab6ea398dac2170d0b7cb10e2c5ae4ea9 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Mon, 19 Feb 2024 23:11:15 +0100 Subject: [PATCH 1/4] DOC: Fix xarray example --- pandas/core/generic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 7614951566bf9..d87433958f357 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3126,10 +3126,10 @@ def to_xarray(self): Coordinates: * index (index) int64 0 1 2 3 Data variables: - name (index) object 'falcon' 'parrot' 'lion' 'monkey' - class (index) object 'bird' 'bird' 'mammal' 'mammal' - max_speed (index) float64 389.0 24.0 80.5 nan - num_legs (index) int64 2 2 4 4 + name (index) object 32B 'falcon' 'parrot' 'lion' 'monkey' + class (index) object 32B 'bird' 'bird' 'mammal' 'mammal' + max_speed (index) float64 32B 389.0 24.0 80.5 nan + num_legs (index) int64 32B 2 2 4 4 >>> df["max_speed"].to_xarray() From f622e7503966b904ae0010669b4b5fa9f263a099 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Tue, 20 Feb 2024 00:04:33 +0100 Subject: [PATCH 2/4] Update --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d87433958f357..e73c3c20c1847 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3124,7 +3124,7 @@ def to_xarray(self): Dimensions: (index: 4) Coordinates: - * index (index) int64 0 1 2 3 + * index (index) int64 32B 0 1 2 3 Data variables: name (index) object 32B 'falcon' 'parrot' 'lion' 'monkey' class (index) object 32B 'bird' 'bird' 'mammal' 'mammal' From 27c6411dbd700496f3ea9bfc3fe1381f650cf372 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:13:06 +0100 Subject: [PATCH 3/4] Skip doctest --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e73c3c20c1847..a60cd2fb59a1e 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3120,7 +3120,7 @@ def to_xarray(self): 2 lion mammal 80.5 4 3 monkey mammal NaN 4 - >>> df.to_xarray() + >>> df.to_xarray() # doctest: +SKIP Dimensions: (index: 4) Coordinates: @@ -3131,7 +3131,7 @@ class (index) object 32B 'bird' 'bird' 'mammal' 'mammal' max_speed (index) float64 32B 389.0 24.0 80.5 nan num_legs (index) int64 32B 2 2 4 4 - >>> df["max_speed"].to_xarray() + >>> df["max_speed"].to_xarray() # doctest: +SKIP array([389. , 24. , 80.5, nan]) Coordinates: From 694cc138f24d335fbe4c763051b513a49a453c84 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:06:45 -0800 Subject: [PATCH 4/4] Igore another doctest --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ddd63d2da35de..3289d0e34aec4 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3157,7 +3157,7 @@ class (index) object 32B 'bird' 'bird' 'mammal' 'mammal' 2018-01-02 falcon 361 parrot 15 - >>> df_multiindex.to_xarray() + >>> df_multiindex.to_xarray() # doctest: +SKIP Dimensions: (date: 2, animal: 2) Coordinates: