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

Method test_getmaskarray

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

Source from the content-addressed store, hash-verified

5010 assert_equal(base[n]._data, base._data[n])
5011
5012 def test_getmaskarray(self):
5013 # Test getmaskarray on flexible dtype
5014 ndtype = [('a', int), ('b', float)]
5015 test = empty(3, dtype=ndtype)
5016 assert_equal(getmaskarray(test),
5017 np.array([(0, 0), (0, 0), (0, 0)],
5018 dtype=[('a', '|b1'), ('b', '|b1')]))
5019 test[:] = masked
5020 assert_equal(getmaskarray(test),
5021 np.array([(1, 1), (1, 1), (1, 1)],
5022 dtype=[('a', '|b1'), ('b', '|b1')]))
5023
5024 def test_view(self):
5025 # Test view w/ flexible dtype

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
getmaskarrayFunction · 0.90
emptyFunction · 0.50

Tested by

no test coverage detected