diff options
author | Robert Cimrman <cimrman3@ntc.zcu.cz> | 2009-07-20 11:59:40 +0000 |
---|---|---|
committer | Robert Cimrman <cimrman3@ntc.zcu.cz> | 2009-07-20 11:59:40 +0000 |
commit | 1319b2ca9c0a7491e5143f2608f444c2b1b7e346 (patch) | |
tree | ac7569257d268dd5f62c018247e32ab5c67434fc /numpy/lib/arraysetops.py | |
parent | 520872500893f95f1676cdf6715c8d34b32a2449 (diff) | |
download | numpy-1319b2ca9c0a7491e5143f2608f444c2b1b7e346.tar.gz |
Fix to setdiff1d (and masked version) + tests (#1133, by N.C.)
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r-- | numpy/lib/arraysetops.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index fe1326aa0..b8ae9a9f3 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -346,7 +346,10 @@ def setdiff1d(ar1, ar2, assume_unique=False): performing set operations on arrays. """ - aux = in1d(ar1, ar2, assume_unique=assume_unique) + if not assume_unique: + ar1 = unique(ar1) + ar2 = unique(ar2) + aux = in1d(ar1, ar2, assume_unique=True) if aux.size == 0: return aux else: |