From 31ee711766c7e65428e24e486e40f9b4dbc1989b Mon Sep 17 00:00:00 2001 From: Keewis Date: Sat, 25 Jun 2022 12:30:37 +0200 Subject: [PATCH 1/2] explicitly set the dataset for demonstration with `to_dict` --- doc/user-guide/io.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/user-guide/io.rst b/doc/user-guide/io.rst index bf8b1870572..ad8d5ca34ed 100644 --- a/doc/user-guide/io.rst +++ b/doc/user-guide/io.rst @@ -1047,6 +1047,8 @@ We can convert a ``Dataset`` (or a ``DataArray``) to a dict using .. ipython:: python + ds = xr.Dataset({"foo": ("x", np.arange(30))}) + d = ds.to_dict() d From 72ecf5e0a4f55d7bc84d54efca733bd6a7bd1751 Mon Sep 17 00:00:00 2001 From: Keewis Date: Sat, 25 Jun 2022 12:37:29 +0200 Subject: [PATCH 2/2] show the dataset for reference --- doc/user-guide/io.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user-guide/io.rst b/doc/user-guide/io.rst index ad8d5ca34ed..5b3d7a324d2 100644 --- a/doc/user-guide/io.rst +++ b/doc/user-guide/io.rst @@ -1048,6 +1048,7 @@ We can convert a ``Dataset`` (or a ``DataArray``) to a dict using .. ipython:: python ds = xr.Dataset({"foo": ("x", np.arange(30))}) + ds d = ds.to_dict() d