MCPcopy Index your code
hub / github.com/numpy/numpy / test_roundtrip_str

Method test_roundtrip_str

numpy/_core/tests/test_multiarray.py:6185–6192  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6183 assert_array_equal(y, x.flatten('F'))
6184
6185 def test_roundtrip_str(self):
6186 x = self._create_data()
6187 x = x.real.ravel()
6188 s = "@".join(map(str, x))
6189 y = np.fromstring(s, sep="@")
6190 nan_mask = ~np.isfinite(x)
6191 assert_array_equal(x[nan_mask], y[nan_mask])
6192 assert_array_equal(x[~nan_mask], y[~nan_mask])
6193
6194 def test_roundtrip_repr(self):
6195 x = self._create_data()

Callers

nothing calls this directly

Calls 5

_create_dataMethod · 0.95
assert_array_equalFunction · 0.90
joinMethod · 0.80
fromstringMethod · 0.80
ravelMethod · 0.45

Tested by

no test coverage detected