MCPcopy
hub / github.com/numpy/numpy / test_stack_masks

Method test_stack_masks

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

Source from the content-addressed store, hash-verified

1884 assert_array_equal(b.mask, c[:, 1].mask)
1885
1886 def test_stack_masks(self):
1887 a = masked_array([0, 1, 2], mask=True)
1888 b = masked_array([9, 8, 7], mask=False)
1889
1890 c = stack([a, b], axis=0)
1891 assert_equal(c.shape, (2, 3))
1892 assert_array_equal(a.mask, c[0].mask)
1893 assert_array_equal(b.mask, c[1].mask)
1894
1895 d = vstack([a, b])
1896 assert_array_equal(c.data, d.data)
1897 assert_array_equal(c.mask, d.mask)
1898
1899 c = stack([a, b], axis=1)
1900 assert_equal(c.shape, (3, 2))
1901 assert_array_equal(a.mask, c[:, 0].mask)
1902 assert_array_equal(b.mask, c[:, 1].mask)
1903
1904 def test_stack_nd(self):
1905 # 2D

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected