MCPcopy
hub / github.com/numpy/numpy / test_nonzero_byteswap

Method test_nonzero_byteswap

numpy/_core/tests/test_regression.py:1648–1654  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1646 assert_array_equal(a2 == a1, [True, False])
1647
1648 def test_nonzero_byteswap(self):
1649 a = np.array([0x80000000, 0x00000080, 0], dtype=np.uint32)
1650 a = a.view(np.float32)
1651 assert_equal(a.nonzero()[0], [1])
1652 a = a.byteswap()
1653 a = a.view(a.dtype.newbyteorder())
1654 assert_equal(a.nonzero()[0], [1]) # [0] if nonzero() ignores swap
1655
1656 def test_empty_mul(self):
1657 a = np.array([1.])

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
nonzeroMethod · 0.80
byteswapMethod · 0.80
viewMethod · 0.45

Tested by

no test coverage detected