MCPcopy Index your code
hub / github.com/pydata/xarray / load_dataset

Function load_dataset

xarray/backends/api.py:143–166  ·  view source on GitHub ↗

Open, load into memory, and close a Dataset from a file or file-like object. This is a thin wrapper around :py:meth:`~xarray.open_dataset`. It differs from `open_dataset` in that it loads the Dataset into memory, closes the file, and returns the Dataset. In contrast, `open_dataset`

(filename_or_obj: T_PathFileOrDataStore, **kwargs)

Source from the content-addressed store, hash-verified

141
142
143def load_dataset(filename_or_obj: T_PathFileOrDataStore, **kwargs) -> Dataset:
144 """Open, load into memory, and close a Dataset from a file or file-like
145 object.
146
147 This is a thin wrapper around :py:meth:`~xarray.open_dataset`. It differs
148 from `open_dataset` in that it loads the Dataset into memory, closes the
149 file, and returns the Dataset. In contrast, `open_dataset` keeps the file
150 handle open and lazy loads its contents. All parameters are passed directly
151 to `open_dataset`. See that documentation for further details.
152
153 Returns
154 -------
155 dataset : Dataset
156 The newly created Dataset.
157
158 See Also
159 --------
160 open_dataset
161 """
162 if "cache" in kwargs:
163 raise TypeError("cache has no effect in this context")
164
165 with open_dataset(filename_or_obj, **kwargs) as ds:
166 return ds.load()
167
168
169def load_dataarray(filename_or_obj: T_PathFileOrDataStore, **kwargs) -> DataArray:

Calls 2

open_datasetFunction · 0.70
loadMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…