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

Method to_numpy

xarray/core/dataarray.py:809–820  ·  view source on GitHub ↗

Coerces wrapped data to numpy and returns a numpy.ndarray. See Also -------- DataArray.as_numpy : Same but returns the surrounding DataArray instead. Dataset.as_numpy DataArray.values DataArray.data

(self)

Source from the content-addressed store, hash-verified

807 self.variable.values = value
808
809 def to_numpy(self) -> np.ndarray:
810 """
811 Coerces wrapped data to numpy and returns a numpy.ndarray.
812
813 See Also
814 --------
815 DataArray.as_numpy : Same but returns the surrounding DataArray instead.
816 Dataset.as_numpy
817 DataArray.values
818 DataArray.data
819 """
820 return self.variable.to_numpy()
821
822 def as_numpy(self) -> Self:
823 """

Callers 15

to_masked_arrayMethod · 0.95
test_to_and_from_dictMethod · 0.95
test_from_numpyMethod · 0.95
test_from_daskMethod · 0.95
test_from_pintMethod · 0.95
test_from_sparseMethod · 0.95
test_from_cupyMethod · 0.95
to_datetime_unboxedFunction · 0.45
decode_cf_timedeltaFunction · 0.45
cftime_to_nptimeFunction · 0.45

Calls

no outgoing calls

Tested by 7

test_to_and_from_dictMethod · 0.76
test_from_numpyMethod · 0.76
test_from_daskMethod · 0.76
test_from_pintMethod · 0.76
test_from_sparseMethod · 0.76
test_from_cupyMethod · 0.76