diff options
author | Lev Abalkin <abalkin@enlnt.com> | 2014-03-05 23:48:34 -0500 |
---|---|---|
committer | Alexander Belopolsky <a@enlnt.com> | 2015-04-23 13:43:34 -0400 |
commit | 1cc2f8bbd69fbe48ed1bc4c00c77956f289aa56c (patch) | |
tree | ad780513fa6e9772dd926a4eec79e0b0a629c603 | |
parent | 02b858326dac217607a83ed0bf4d7d51d5bfbfbe (diff) | |
download | numpy-1cc2f8bbd69fbe48ed1bc4c00c77956f289aa56c.tar.gz |
TST: Test that masked array addition works when dtype=object
See issue #4452.
-rw-r--r-- | numpy/ma/tests/test_core.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index 807fc0ba6..f0d5d6788 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -2953,6 +2953,12 @@ class TestMaskedArrayMathMethods(TestCase): assert_equal(mX.ptp(0), cols) assert_equal(mX.ptp(1), rows) + def test_add_object(self): + x = masked_array(['a', 'b'], mask = [1, 0], dtype=object) + y = x + 'x' + assert_equal(y[1], 'bx') + assert_(y.mask[0]) + def test_sum_object(self): # Test sum on object dtype a = masked_array([1, 2, 3], mask=[1, 0, 0], dtype=np.object) |