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

Method test_3d

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

Source from the content-addressed store, hash-verified

985 assert_equal(median(x, axis=1).mask, [1, 1, 1, 0, 0, 0, 0, 1, 1, 1])
986
987 def test_3d(self):
988 # Tests median w/ 3D
989 x = np.ma.arange(24).reshape(3, 4, 2)
990 x[x % 3 == 0] = masked
991 assert_equal(median(x, 0), [[12, 9], [6, 15], [12, 9], [18, 15]])
992 x.shape = (4, 3, 2)
993 assert_equal(median(x, 0), [[99, 10], [11, 99], [13, 14]])
994 x = np.ma.arange(24).reshape(4, 3, 2)
995 x[x % 5 == 0] = masked
996 assert_equal(median(x, 0), [[12, 10], [8, 9], [16, 17]])
997
998 def test_neg_axis(self):
999 x = masked_array(np.arange(30).reshape(10, 3))

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
medianFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected