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

Method test_3d

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

Source from the content-addressed store, hash-verified

1073 assert_equal(median(x, axis=1).mask, [1, 1, 1, 0, 0, 0, 0, 1, 1, 1])
1074
1075 def test_3d(self):
1076 # Tests median w/ 3D
1077 x = np.ma.arange(24).reshape(3, 4, 2)
1078 x[x % 3 == 0] = masked
1079 assert_equal(median(x, 0), [[12, 9], [6, 15], [12, 9], [18, 15]])
1080 x = x.reshape((4, 3, 2))
1081 assert_equal(median(x, 0), [[99, 10], [11, 99], [13, 14]])
1082 x = np.ma.arange(24).reshape(4, 3, 2)
1083 x[x % 5 == 0] = masked
1084 assert_equal(median(x, 0), [[12, 10], [8, 9], [16, 17]])
1085
1086 def test_neg_axis(self):
1087 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