diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2007-08-21 08:14:20 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2007-08-21 08:14:20 +0000 |
commit | c8b44bcca6c5be9d6df67d775fd0250c83e73455 (patch) | |
tree | 8b202f234cadfe1b43aea3ab6ba4b95b4ac58f4f /numpy | |
parent | a46f16e2ec8ca594adc8a0c0203852e23c041901 (diff) | |
download | numpy-c8b44bcca6c5be9d6df67d775fd0250c83e73455.tar.gz |
Add record array test for putmask.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 7284de3ac..174c994e9 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -443,6 +443,18 @@ class test_putmask(ParametricTestCase): self.failUnlessRaises(ValueError,N.putmask, N.array([1,2,3]),[True],5) + def test_record_array(self): + rec = N.array([(-5, 2.0, 3.0), (5.0, 4.0, 3.0)], + dtype=[('x', '<f8'), ('y', '<f8'), ('z', '<f8')]) + N.putmask(rec['x'],[True,False],10) + assert_array_equal(rec['x'],[10,5]) + + def test_masked_array(self): + ## x = N.array([1,2,3]) + ## z = N.ma.array(x,mask=[True,False,False]) + ## N.putmask(z,[True,True,True],3) + pass + # Import tests from unicode set_local_path() from test_unicode import * |