Skip to content

Commit d86a959

Browse files
eric-wiesercharris
authored andcommitted
TST: Verify np.ma.take works on scalars
See numpy#7585
1 parent 1a7d6d6 commit d86a959

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎numpy/ma/tests/test_core.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,6 +2955,10 @@ def test_take(self):
29552955
assert_equal(x.take([[0, 1], [0, 1]]),
29562956
masked_array([[10, 20], [10, 20]], [[0, 1], [0, 1]]))
29572957

2958+
# assert_equal crashes when passed np.ma.mask
2959+
self.assertTrue(x[1] is np.ma.masked)
2960+
self.assertTrue(x.take(1) is np.ma.masked)
2961+
29582962
x = array([[10, 20, 30], [40, 50, 60]], mask=[[0, 0, 1], [1, 0, 0, ]])
29592963
assert_equal(x.take([0, 2], axis=1),
29602964
array([[10, 30], [40, 60]], mask=[[0, 1], [1, 0]]))

0 commit comments

Comments
 (0)