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

Method test_out

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

Source from the content-addressed store, hash-verified

1015 assert_(type(r) is MaskedArray)
1016
1017 def test_out(self):
1018 # integer float even odd
1019 for v in (40, 40., 30, 30.):
1020 x = masked_array(np.arange(v).reshape(10, -1))
1021 x[:3] = x[-3:] = masked
1022 out = masked_array(np.ones(10))
1023 r = median(x, axis=1, out=out)
1024 if v == 30:
1025 e = masked_array([0.]*3 + [10, 13, 16, 19] + [0.]*3,
1026 mask=[True] * 3 + [False] * 4 + [True] * 3)
1027 else:
1028 e = masked_array([0.]*3 + [13.5, 17.5, 21.5, 25.5] + [0.]*3,
1029 mask=[True]*3 + [False]*4 + [True]*3)
1030 assert_equal(r, e)
1031 assert_(r is out)
1032 assert_(type(r) is MaskedArray)
1033
1034 @pytest.mark.parametrize(
1035 argnames='axis',

Callers

nothing calls this directly

Calls 4

medianFunction · 0.90
assert_equalFunction · 0.90
reshapeMethod · 0.80
assert_Function · 0.50

Tested by

no test coverage detected