(self)
| 3672 | assert_equal(mXXswapped.shape, (2, 2, 3, 3)) |
| 3673 | |
| 3674 | def test_take(self): |
| 3675 | # Tests take |
| 3676 | x = masked_array([10, 20, 30, 40], [0, 1, 0, 1]) |
| 3677 | assert_equal(x.take([0, 0, 3]), masked_array([10, 10, 40], [0, 0, 1])) |
| 3678 | assert_equal(x.take([0, 0, 3]), x[[0, 0, 3]]) |
| 3679 | assert_equal(x.take([[0, 1], [0, 1]]), |
| 3680 | masked_array([[10, 20], [10, 20]], [[0, 1], [0, 1]])) |
| 3681 | |
| 3682 | # assert_equal crashes when passed np.ma.mask |
| 3683 | assert_(x[1] is np.ma.masked) |
| 3684 | assert_(x.take(1) is np.ma.masked) |
| 3685 | |
| 3686 | x = array([[10, 20, 30], [40, 50, 60]], mask=[[0, 0, 1], [1, 0, 0, ]]) |
| 3687 | assert_equal(x.take([0, 2], axis=1), |
| 3688 | array([[10, 30], [40, 60]], mask=[[0, 1], [1, 0]])) |
| 3689 | assert_equal(take(x, [0, 2], axis=1), |
| 3690 | array([[10, 30], [40, 60]], mask=[[0, 1], [1, 0]])) |
| 3691 | |
| 3692 | def test_take_masked_indices(self): |
| 3693 | # Test take w/ masked indices |
nothing calls this directly
no test coverage detected