(self)
| 3910 | assert_equal(mXXswapped.shape, (2, 2, 3, 3)) |
| 3911 | |
| 3912 | def test_take(self): |
| 3913 | # Tests take |
| 3914 | x = masked_array([10, 20, 30, 40], [0, 1, 0, 1]) |
| 3915 | assert_equal(x.take([0, 0, 3]), masked_array([10, 10, 40], [0, 0, 1])) |
| 3916 | assert_equal(x.take([0, 0, 3]), x[[0, 0, 3]]) |
| 3917 | assert_equal(x.take([[0, 1], [0, 1]]), |
| 3918 | masked_array([[10, 20], [10, 20]], [[0, 1], [0, 1]])) |
| 3919 | |
| 3920 | # assert_equal crashes when passed np.ma.mask |
| 3921 | assert_(x[1] is np.ma.masked) |
| 3922 | assert_(x.take(1) is np.ma.masked) |
| 3923 | |
| 3924 | x = array([[10, 20, 30], [40, 50, 60]], mask=[[0, 0, 1], [1, 0, 0, ]]) |
| 3925 | assert_equal(x.take([0, 2], axis=1), |
| 3926 | array([[10, 30], [40, 60]], mask=[[0, 1], [1, 0]])) |
| 3927 | assert_equal(take(x, [0, 2], axis=1), |
| 3928 | array([[10, 30], [40, 60]], mask=[[0, 1], [1, 0]])) |
| 3929 | |
| 3930 | def test_take_masked_indices(self): |
| 3931 | # Test take w/ masked indices |
nothing calls this directly
no test coverage detected