diff options
author | Jay Bourque <jay.bourque@continuum.io> | 2013-04-03 14:01:31 -0500 |
---|---|---|
committer | Jay Bourque <jay.bourque@continuum.io> | 2013-08-16 16:39:31 -0500 |
commit | 5dea4ca1d3c6185a530e40a6ea7099e3eb3fd46c (patch) | |
tree | 8621e759de1e355a3afeff2634cb6e67b7f0b9fb /numpy | |
parent | 1e786ea00d9ca74bd236ed31117f1e1eb41d1484 (diff) | |
download | numpy-5dea4ca1d3c6185a530e40a6ea7099e3eb3fd46c.tar.gz |
Add test for boolean indexing and boolean ufunc
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_ufunc.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py index c87012014..7373d5ae5 100644 --- a/numpy/core/tests/test_ufunc.py +++ b/numpy/core/tests/test_ufunc.py @@ -972,6 +972,11 @@ class TestUfunc(TestCase): np.power.at(a, [1,2,3,2], 3.5) assert_equal(a, [0, 1, 4414, 46, 4, 5, 6, 7, 8, 9]) + # Test boolean indexing and boolean ufuncs + a = np.arange(10) + index = a % 2 == 0 + np.equal.at(a, index, [0, 2, 4, 6, 8]) + assert_equal(a, [1, 1, 1, 3, 1, 5, 1, 7, 1, 9]) if __name__ == "__main__": run_module_suite() |