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

Method test_stack_1d

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

Source from the content-addressed store, hash-verified

1791class TestStack:
1792
1793 def test_stack_1d(self):
1794 a = masked_array([0, 1, 2], mask=[0, 1, 0])
1795 b = masked_array([9, 8, 7], mask=[1, 0, 0])
1796
1797 c = stack([a, b], axis=0)
1798 assert_equal(c.shape, (2, 3))
1799 assert_array_equal(a.mask, c[0].mask)
1800 assert_array_equal(b.mask, c[1].mask)
1801
1802 d = vstack([a, b])
1803 assert_array_equal(c.data, d.data)
1804 assert_array_equal(c.mask, d.mask)
1805
1806 c = stack([a, b], axis=1)
1807 assert_equal(c.shape, (3, 2))
1808 assert_array_equal(a.mask, c[:, 0].mask)
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)

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