diff --git a/doc/getting-started-guide/quick-overview.rst b/doc/getting-started-guide/quick-overview.rst index 1a2bc809550..aa822ea6373 100644 --- a/doc/getting-started-guide/quick-overview.rst +++ b/doc/getting-started-guide/quick-overview.rst @@ -176,7 +176,7 @@ objects. You can think of it as a multi-dimensional generalization of the .. ipython:: python - ds = xr.Dataset({"foo": data, "bar": ("x", [1, 2]), "baz": np.pi}) + ds = xr.Dataset(dict(foo=data, bar=("x", [1, 2]), baz=np.pi)) ds diff --git a/doc/internals/duck-arrays-integration.rst b/doc/internals/duck-arrays-integration.rst index 2bc3c1f9158..1f492c82a62 100644 --- a/doc/internals/duck-arrays-integration.rst +++ b/doc/internals/duck-arrays-integration.rst @@ -48,4 +48,4 @@ To avoid duplicated information, this method must omit information about the sha b = sparse.COO.from_numpy(b) b - xr.Dataset({"a": ("x", a), "b": (("y", "z"), b)}) + xr.Dataset(dict(a=("x", a), b=(("y", "z"), b))) diff --git a/doc/user-guide/data-structures.rst b/doc/user-guide/data-structures.rst index 558f03a721b..f59f561fb09 100644 --- a/doc/user-guide/data-structures.rst +++ b/doc/user-guide/data-structures.rst @@ -310,12 +310,12 @@ in the dictionary: .. ipython:: python - xr.Dataset({"bar": foo}) + xr.Dataset(dict(bar=foo)) .. ipython:: python - xr.Dataset({"bar": foo.to_pandas()}) + xr.Dataset(dict(bar=foo.to_pandas())) Where a pandas object is supplied as a value, the names of its indexes are used as dimension names, and its data is aligned to any existing dimensions.