MCPcopy Index your code
hub / github.com/numpy/numpy / test_out

Method test_out

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

Source from the content-addressed store, hash-verified

1103 assert_(type(r) is MaskedArray)
1104
1105 def test_out(self):
1106 # integer float even odd
1107 for v in (40, 40., 30, 30.):
1108 x = masked_array(np.arange(v).reshape(10, -1))
1109 x[:3] = x[-3:] = masked
1110 out = masked_array(np.ones(10))
1111 r = median(x, axis=1, out=out)
1112 if v == 30:
1113 e = masked_array([0.] * 3 + [10, 13, 16, 19] + [0.] * 3,
1114 mask=[True] * 3 + [False] * 4 + [True] * 3)
1115 else:
1116 e = masked_array([0.] * 3 + [13.5, 17.5, 21.5, 25.5] + [0.] * 3,
1117 mask=[True] * 3 + [False] * 4 + [True] * 3)
1118 assert_equal(r, e)
1119 assert_(r is out)
1120 assert_(type(r) is MaskedArray)
1121
1122 @pytest.mark.parametrize(
1123 argnames='axis',

Callers

nothing calls this directly

Calls 4

medianFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.85
reshapeMethod · 0.80

Tested by

no test coverage detected