summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-04-23 15:27:53 -0400
committerCharles Harris <charlesr.harris@gmail.com>2015-04-23 15:27:53 -0400
commit9d7beb16041bc4d7d458dbe000905b4e9956c01b (patch)
treeffaae9060da82d1b3ec16be158418d3e5ce7a4a2
parenteb81ac4f57e8e4b1ad28188b5e0e2dc9135b5c10 (diff)
parent1cc2f8bbd69fbe48ed1bc4c00c77956f289aa56c (diff)
downloadnumpy-9d7beb16041bc4d7d458dbe000905b4e9956c01b.tar.gz
Merge pull request #4453 from abalkin/issue-4452
BUG: Masked array addition does not work when dtype=object
-rw-r--r--numpy/ma/tests/test_core.py6
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)