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

Method test_getmaskarray

numpy/ma/tests/test_core.py:5273–5283  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5271 assert_equal(base[n]._data, base._data[n])
5272
5273 def test_getmaskarray(self):
5274 # Test getmaskarray on flexible dtype
5275 ndtype = [('a', int), ('b', float)]
5276 test = empty(3, dtype=ndtype)
5277 assert_equal(getmaskarray(test),
5278 np.array([(0, 0), (0, 0), (0, 0)],
5279 dtype=[('a', '|b1'), ('b', '|b1')]))
5280 test[:] = masked
5281 assert_equal(getmaskarray(test),
5282 np.array([(1, 1), (1, 1), (1, 1)],
5283 dtype=[('a', '|b1'), ('b', '|b1')]))
5284
5285 def test_view(self):
5286 # Test view w/ flexible dtype

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
getmaskarrayFunction · 0.90
emptyFunction · 0.85

Tested by

no test coverage detected