Skip to content

Commit 33a1cd7

Browse files
phoflmroeschke
andauthored
DOC: Fix xarray example (pandas-dev#57510)
* DOC: Fix xarray example * Update * Skip doctest * Igore another doctest --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 5a862b5 commit 33a1cd7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/core/generic.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -3120,18 +3120,18 @@ def to_xarray(self):
31203120
2 lion mammal 80.5 4
31213121
3 monkey mammal NaN 4
31223122
3123-
>>> df.to_xarray()
3123+
>>> df.to_xarray() # doctest: +SKIP
31243124
<xarray.Dataset>
31253125
Dimensions: (index: 4)
31263126
Coordinates:
3127-
* index (index) int64 0 1 2 3
3127+
* index (index) int64 32B 0 1 2 3
31283128
Data variables:
3129-
name (index) object 'falcon' 'parrot' 'lion' 'monkey'
3130-
class (index) object 'bird' 'bird' 'mammal' 'mammal'
3131-
max_speed (index) float64 389.0 24.0 80.5 nan
3132-
num_legs (index) int64 2 2 4 4
3129+
name (index) object 32B 'falcon' 'parrot' 'lion' 'monkey'
3130+
class (index) object 32B 'bird' 'bird' 'mammal' 'mammal'
3131+
max_speed (index) float64 32B 389.0 24.0 80.5 nan
3132+
num_legs (index) int64 32B 2 2 4 4
31333133
3134-
>>> df["max_speed"].to_xarray()
3134+
>>> df["max_speed"].to_xarray() # doctest: +SKIP
31353135
<xarray.DataArray 'max_speed' (index: 4)>
31363136
array([389. , 24. , 80.5, nan])
31373137
Coordinates:
@@ -3157,7 +3157,7 @@ class (index) object 'bird' 'bird' 'mammal' 'mammal'
31573157
2018-01-02 falcon 361
31583158
parrot 15
31593159
3160-
>>> df_multiindex.to_xarray()
3160+
>>> df_multiindex.to_xarray() # doctest: +SKIP
31613161
<xarray.Dataset>
31623162
Dimensions: (date: 2, animal: 2)
31633163
Coordinates:

0 commit comments

Comments
 (0)