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

Method test_endian_bool_indexing

numpy/core/tests/test_regression.py:151–162  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

149 {'names':['a'], 'formats':['foo']}, align=1)
150
151 def test_endian_bool_indexing(self):
152 # Ticket #105
153 a = np.arange(10., dtype='>f8')
154 b = np.arange(10., dtype='<f8')
155 xa = np.where((a > 2) & (a < 6))
156 xb = np.where((b > 2) & (b < 6))
157 ya = ((a > 2) & (a < 6))
158 yb = ((b > 2) & (b < 6))
159 assert_array_almost_equal(xa, ya.nonzero())
160 assert_array_almost_equal(xb, yb.nonzero())
161 assert_(np.all(a[ya] > 0.5))
162 assert_(np.all(b[yb] > 0.5))
163
164 def test_endian_where(self):
165 # 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