(self)
| 973 | assert_equal(median(z.T, axis=1), np.zeros(p)) |
| 974 | |
| 975 | def test_2d_waxis(self): |
| 976 | # Tests median w/ 2D arrays and different axis. |
| 977 | x = masked_array(np.arange(30).reshape(10, 3)) |
| 978 | x[:3] = x[-3:] = masked |
| 979 | assert_equal(median(x), 14.5) |
| 980 | assert_(type(np.ma.median(x)) is not MaskedArray) |
| 981 | assert_equal(median(x, axis=0), [13.5, 14.5, 15.5]) |
| 982 | assert_(type(np.ma.median(x, axis=0)) is MaskedArray) |
| 983 | assert_equal(median(x, axis=1), [0, 0, 0, 10, 13, 16, 19, 0, 0, 0]) |
| 984 | assert_(type(np.ma.median(x, axis=1)) is MaskedArray) |
| 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 |
nothing calls this directly
no test coverage detected