cupy.in1d#

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

Tests whether each element of a 1-D array is also present in a second array.

Returns a boolean array the same length as ar1 that is True where an element of ar1 is in ar2 and False otherwise.

Parameters
  • ar1 (cupy.ndarray) – Input array.

  • ar2 (cupy.ndarray) – The values against which to test each value of ar1.

  • assume_unique (bool, optional) – Ignored

  • invert (bool, optional) – If True, the values in the returned array are inverted (that is, False where an element of ar1 is in ar2 and True otherwise). Default is False.

Returns

y – The values ar1[in1d] are in ar2.

Return type

cupy.ndarray, bool