numpy.setdiff1d(ar1, ar2, assume_unique=False)
[source]
Find the set difference of two arrays.
Return the unique values in ar1
that are not in ar2
.
Parameters: |
|
---|---|
Returns: |
|
See also
numpy.lib.arraysetops
>>> a = np.array([1, 2, 3, 2, 4, 1]) >>> b = np.array([3, 4, 5, 6]) >>> np.setdiff1d(a, b) array([1, 2])
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.setdiff1d.html