ma.in1d(ar1, ar2, assume_unique=False, invert=False)[source]#

Test whether each element of an array is also present in a second array.

The output is always a masked array. See numpy.in1d for more details.

We recommend using isin instead of in1d for new code.

See also


Version of this function that preserves the shape of ar1.


Equivalent function for ndarrays.


New in version 1.4.0.