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

Method test_view

numpy/matrixlib/tests/test_masked_matrix.py:170–179  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

168 assert_equal(aravel._mask.shape, a.shape)
169
170 def test_view(self):
171 # Test view w/ flexible dtype
172 iterator = list(zip(np.arange(10), np.random.rand(10)))
173 data = np.array(iterator)
174 a = masked_array(iterator, dtype=[('a', float), ('b', float)])
175 a.mask[0] = (1, 0)
176 test = a.view((float, 2), np.matrix)
177 assert_equal(test, data)
178 assert_(isinstance(test, np.matrix))
179 assert_(not isinstance(test, MaskedArray))
180
181
182class TestSubclassing:

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
assert_Function · 0.85
viewMethod · 0.45

Tested by

no test coverage detected