MCPcopy Create free account
hub / github.com/numpy/numpy / test_roundtrip_binary_str

Method test_roundtrip_binary_str

numpy/core/tests/test_multiarray.py:5340–5347  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

5338 assert_array_equal(y, x)
5339
5340 def test_roundtrip_binary_str(self, x):
5341 s = x.tobytes()
5342 y = np.frombuffer(s, dtype=x.dtype)
5343 assert_array_equal(y, x.flat)
5344
5345 s = x.tobytes('F')
5346 y = np.frombuffer(s, dtype=x.dtype)
5347 assert_array_equal(y, x.flatten('F'))
5348
5349 def test_roundtrip_str(self, x):
5350 x = x.real.ravel()

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
flattenMethod · 0.80
tobytesMethod · 0.45

Tested by

no test coverage detected