numpy.setmember1d

numpy.setmember1d(ar1, ar2)

Return a boolean array set True where first element is in second array.

Boolean array is the shape of ar1 containing True where the elements of ar1 are in ar2 and False otherwise.

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 array.

Returns:

mask : ndarray, bool

The values ar1[mask] are in ar2.

See also

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

Previous topic

numpy.setdiff1d

Next topic

numpy.setxor1d

This Page

Quick search