numpy.setdiff1d

numpy.setdiff1d(ar1, ar2)

Set difference of 1D arrays with unique elements.

Use unique1d() to generate arrays with only unique elements to use as inputs to this function.

Parameters:

ar1 : array_like

Input array.

ar2 : array_like

Input comparison array.

Returns:

difference : ndarray

The values in ar1 that are not in ar2.

See also

numpy.lib.arraysetops
Module with a number of other functions for performing set operations on arrays.

Previous topic

numpy.intersect1d_nu

Next topic

numpy.setmember1d

This Page

Quick search