diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2008-08-13 17:23:25 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2008-08-13 17:23:25 +0000 |
commit | 8b54222dbd5890df1480d769a51f1f8541f9a06f (patch) | |
tree | 86b22eed06180d2508eaae3dbb97784754e54864 /numpy/lib/tests/test_arraysetops.py | |
parent | 086afd5bfd7b8617e721a6467ce29b6acc41c44c (diff) | |
download | numpy-8b54222dbd5890df1480d769a51f1f8541f9a06f.tar.gz |
Unique1d will now return unique as well as reverse indices. Fix order of
returns [patch by Robert Cimrman].
Diffstat (limited to 'numpy/lib/tests/test_arraysetops.py')
-rw-r--r-- | numpy/lib/tests/test_arraysetops.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index 474842c8a..c40cf9d20 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -6,6 +6,8 @@ from numpy.testing import * import numpy as np from numpy.lib.arraysetops import * +import warnings + class TestAso(TestCase): def test_unique1d( self ): a = np.array( [5, 7, 1, 2, 1, 5, 7] ) @@ -14,11 +16,13 @@ class TestAso(TestCase): c = unique1d( a ) assert_array_equal( c, ec ) - d, c = unique1d( a, True ) - ed = np.array( [2, 3, 0, 1] ) + warnings.simplefilter('ignore', Warning) + unique, indices = unique1d( a, return_index=True ) + warnings.resetwarnings() - assert_array_equal( d,ed ) - assert_array_equal( c, ec ) + ed = np.array( [2, 3, 0, 1] ) + assert_array_equal(unique, ec) + assert_array_equal(indices, ed) assert_array_equal([], unique1d([])) |