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

Method test_stack_masks

numpy/ma/tests/test_extras.py:1811–1827  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1809 assert_array_equal(b.mask, c[:, 1].mask)
1810
1811 def test_stack_masks(self):
1812 a = masked_array([0, 1, 2], mask=True)
1813 b = masked_array([9, 8, 7], mask=False)
1814
1815 c = stack([a, b], axis=0)
1816 assert_equal(c.shape, (2, 3))
1817 assert_array_equal(a.mask, c[0].mask)
1818 assert_array_equal(b.mask, c[1].mask)
1819
1820 d = vstack([a, b])
1821 assert_array_equal(c.data, d.data)
1822 assert_array_equal(c.mask, d.mask)
1823
1824 c = stack([a, b], axis=1)
1825 assert_equal(c.shape, (3, 2))
1826 assert_array_equal(a.mask, c[:, 0].mask)
1827 assert_array_equal(b.mask, c[:, 1].mask)
1828
1829 def test_stack_nd(self):
1830 # 2D

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
assert_array_equalFunction · 0.90
vstackFunction · 0.85
stackFunction · 0.50

Tested by

no test coverage detected