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

Method test_endian_bool_indexing

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

Source from the content-addressed store, hash-verified

169 np.dtype({'names': ['a'], 'formats': ['foo']}, align=True)
170
171 def test_endian_bool_indexing(self):
172 # Ticket #105
173 a = np.arange(10., dtype='>f8')
174 b = np.arange(10., dtype='<f8')
175 xa = np.where((a > 2) & (a < 6))
176 xb = np.where((b > 2) & (b < 6))
177 ya = ((a > 2) & (a < 6))
178 yb = ((b > 2) & (b < 6))
179 assert_array_almost_equal(xa, ya.nonzero())
180 assert_array_almost_equal(xb, yb.nonzero())
181 assert_(np.all(a[ya] > 0.5))
182 assert_(np.all(b[yb] > 0.5))
183
184 def test_endian_where(self):
185 # GitHub issue #369

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
nonzeroMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected