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

Method test_out_1d

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

Source from the content-addressed store, hash-verified

1001 assert_equal(median(x, axis=-1), median(x, axis=1))
1002
1003 def test_out_1d(self):
1004 # integer float even odd
1005 for v in (30, 30., 31, 31.):
1006 x = masked_array(np.arange(v))
1007 x[:3] = x[-3:] = masked
1008 out = masked_array(np.ones(()))
1009 r = median(x, out=out)
1010 if v == 30:
1011 assert_equal(out, 14.5)
1012 else:
1013 assert_equal(out, 15.)
1014 assert_(r is out)
1015 assert_(type(r) is MaskedArray)
1016
1017 def test_out(self):
1018 # integer float even odd

Callers

nothing calls this directly

Calls 3

medianFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.50

Tested by

no test coverage detected