From f13da94db8ab4b564938a5e67435ac709698f1c9 Mon Sep 17 00:00:00 2001 From: Benoit Bovy Date: Tue, 5 Sep 2023 10:35:36 +0200 Subject: [PATCH] fix doctests: pandas 2.1 MultiIndex repr with nan (#8141) Co-authored-by: Mathias Hauser --- xarray/core/dataarray.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 3fab6e8cf0a..5a68fc7ffac 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -2904,9 +2904,9 @@ def to_unstacked_dataset(self, dim: Hashable, level: int | Hashable = 0) -> Data b (x) int64 0 3 >>> stacked = data.to_stacked_array("z", ["x"]) >>> stacked.indexes["z"] - MultiIndex([('a', 0.0), - ('a', 1.0), - ('a', 2.0), + MultiIndex([('a', 0), + ('a', 1), + ('a', 2), ('b', nan)], name='z') >>> roundtripped = stacked.to_unstacked_dataset(dim="z")