cupy.isin(element, test_elements, assume_unique=False, invert=False)[source]

Calculates element in test_elements, broadcasting over element only. Returns a boolean array of the same shape as element that is True where an element of element is in test_elements and False otherwise.

  • element (cupy.ndarray) – Input array.

  • test_elements (cupy.ndarray) – The values against which to test each value of element. This argument is flattened if it is an array or array_like.

  • assume_unique (bool, optional) – Ignored

  • invert (bool, optional) – If True, the values in the returned array are inverted, as if calculating element not in test_elements. Default is False.


Has the same shape as element. The values element[isin] are in test_elements.

Return type

cupy.ndarray, bool