MCPcopy
hub / github.com/pydata/xarray / as_numpy

Method as_numpy

xarray/core/dataset.py:1182–1192  ·  view source on GitHub ↗

Coerces wrapped data and coordinates into numpy arrays, returning a Dataset. See Also -------- DataArray.as_numpy DataArray.to_numpy : Returns only the data as a numpy.ndarray object.

(self)

Source from the content-addressed store, hash-verified

1180 return self._copy(deep=True, memo=memo)
1181
1182 def as_numpy(self) -> Self:
1183 """
1184 Coerces wrapped data and coordinates into numpy arrays, returning a Dataset.
1185
1186 See Also
1187 --------
1188 DataArray.as_numpy
1189 DataArray.to_numpy : Returns only the data as a numpy.ndarray object.
1190 """
1191 numpy_variables = {k: v.as_numpy() for k, v in self.variables.items()}
1192 return self._replace(variables=numpy_variables)
1193
1194 def _copy_listed(self, names: Iterable[Hashable]) -> Self:
1195 """Create a new Dataset with the listed variables from this dataset and

Callers 14

test_from_numpyMethod · 0.95
test_from_pintMethod · 0.95
test_from_sparseMethod · 0.95
test_from_cupyMethod · 0.95
newplotfuncFunction · 0.45
test_from_daskMethod · 0.45
test_from_daskMethod · 0.45
test_from_numpyMethod · 0.45
test_from_daskMethod · 0.45
test_from_pintMethod · 0.45
test_from_sparseMethod · 0.45

Calls 2

_replaceMethod · 0.95
itemsMethod · 0.80

Tested by 13

test_from_numpyMethod · 0.76
test_from_pintMethod · 0.76
test_from_sparseMethod · 0.76
test_from_cupyMethod · 0.76
test_from_daskMethod · 0.36
test_from_daskMethod · 0.36
test_from_numpyMethod · 0.36
test_from_daskMethod · 0.36
test_from_pintMethod · 0.36
test_from_sparseMethod · 0.36
test_from_cupyMethod · 0.36