(self)
| 1061 | assert_equal(median(z.T, axis=1), np.zeros(p)) |
| 1062 | |
| 1063 | def test_2d_waxis(self): |
| 1064 | # Tests median w/ 2D arrays and different axis. |
| 1065 | x = masked_array(np.arange(30).reshape(10, 3)) |
| 1066 | x[:3] = x[-3:] = masked |
| 1067 | assert_equal(median(x), 14.5) |
| 1068 | assert_(type(np.ma.median(x)) is not MaskedArray) |
| 1069 | assert_equal(median(x, axis=0), [13.5, 14.5, 15.5]) |
| 1070 | assert_(type(np.ma.median(x, axis=0)) is MaskedArray) |
| 1071 | assert_equal(median(x, axis=1), [0, 0, 0, 10, 13, 16, 19, 0, 0, 0]) |
| 1072 | assert_(type(np.ma.median(x, axis=1)) is MaskedArray) |
| 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 |
nothing calls this directly
no test coverage detected