Skip to content

Commit 6e5aa5e

Browse files
committed
TST: Verify np.ma.take works on scalars
See numpy#7585
1 parent 3c394f7 commit 6e5aa5e

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
@@ -2998,6 +2998,10 @@ def test_take(self):
29982998
assert_equal(x.take([[0, 1], [0, 1]]),
29992999
masked_array([[10, 20], [10, 20]], [[0, 1], [0, 1]]))
30003000

3001+
# assert_equal crashes when passed np.ma.mask
3002+
self.assertIs(x[1], np.ma.masked)
3003+
self.assertIs(x.take(1), np.ma.masked)
3004+
30013005
x = array([[10, 20, 30], [40, 50, 60]], mask=[[0, 0, 1], [1, 0, 0, ]])
30023006
assert_equal(x.take([0, 2], axis=1),
30033007
array([[10, 30], [40, 60]], mask=[[0, 1], [1, 0]]))

0 commit comments

Comments
 (0)