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

Method test_roundtrip_binary_str

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

Source from the content-addressed store, hash-verified

6173 assert_array_equal(y, x)
6174
6175 def test_roundtrip_binary_str(self):
6176 x = self._create_data()
6177 s = x.tobytes()
6178 y = np.frombuffer(s, dtype=x.dtype)
6179 assert_array_equal(y, x.flat)
6180
6181 s = x.tobytes('F')
6182 y = np.frombuffer(s, dtype=x.dtype)
6183 assert_array_equal(y, x.flatten('F'))
6184
6185 def test_roundtrip_str(self):
6186 x = self._create_data()

Callers

nothing calls this directly

Calls 4

_create_dataMethod · 0.95
assert_array_equalFunction · 0.90
flattenMethod · 0.80
tobytesMethod · 0.45

Tested by

no test coverage detected