diff options
author | Greg Lucas <greg.lucas@lasp.colorado.edu> | 2020-04-15 10:28:02 -0600 |
---|---|---|
committer | Greg Lucas <greg.m.lucas@gmail.com> | 2022-06-29 19:17:15 -0600 |
commit | 6d77c591c59b5678f14ae5af2127eebb7d2415bc (patch) | |
tree | 0c406f4d9519a563a8e30fec3a71d89e0f847c4a /numpy/ma/tests | |
parent | f9bed20bffd88bce06dbc8be200179edfe7580a4 (diff) | |
download | numpy-6d77c591c59b5678f14ae5af2127eebb7d2415bc.tar.gz |
ENH: Adding __array_ufunc__ capability to MaskedArrays.
This enables any ufunc numpy operations that are called on a
MaskedArray to use the masked version of that function automatically
without needing to resort to np.ma.func() calls.
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r-- | numpy/ma/tests/test_core.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index b056d5169..5b779edcb 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -3208,7 +3208,7 @@ class TestMaskedArrayMethods: assert_equal(b.fill_value, 9999) assert_equal(b, a[condition]) - condition = (a < 4.) + condition = (a.data < 4.) b = a.compress(condition) assert_equal(b._data, [1., 2., 3.]) assert_equal(b._mask, [0, 0, 1]) @@ -5367,7 +5367,7 @@ def test_ufunc_with_out_varied(): a = array([ 1, 2, 3], mask=[1, 0, 0]) b = array([10, 20, 30], mask=[1, 0, 0]) out = array([ 0, 0, 0], mask=[0, 0, 1]) - expected = array([11, 22, 33], mask=[1, 0, 0]) + expected = array([1, 22, 33], mask=[1, 0, 0]) out_pos = out.copy() res_pos = np.add(a, b, out_pos) |