diff options
author | Jaime <jaime.frio@gmail.com> | 2017-07-28 10:43:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-28 10:43:06 +0200 |
commit | 2791167653a1b586aa54830cc2ab4f736cbe4f0a (patch) | |
tree | 25bf1de21c25e88de871888b3e8b237bf2d8cc9a /numpy/lib/arraysetops.py | |
parent | 8faf51250a06dcb7abd0bcece1f86b11059d2c61 (diff) | |
parent | 5c213e98bf7721de20e6bc938eaa40349cba883e (diff) | |
download | numpy-2791167653a1b586aa54830cc2ab4f736cbe4f0a.tar.gz |
Merge pull request #9470 from wufangjie/setxor1d
MAINT: Make `setxor1d' a bit clearer and speed it up
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r-- | numpy/lib/arraysetops.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 9b0a1193f..aa3a05e12 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -375,11 +375,8 @@ def setxor1d(ar1, ar2, assume_unique=False): return aux aux.sort() -# flag = ediff1d( aux, to_end = 1, to_begin = 1 ) == 0 flag = np.concatenate(([True], aux[1:] != aux[:-1], [True])) -# flag2 = ediff1d( flag ) == 0 - flag2 = flag[1:] == flag[:-1] - return aux[flag2] + return aux[flag[1:] & flag[:-1]] def in1d(ar1, ar2, assume_unique=False, invert=False): |