Calculates element in test_elements, broadcasting over element only.
The output is always a masked array of the same shape as element. See numpy.isin for more details.
See also
in1dFlattened version of this function.
numpy.isinEquivalent function for ndarrays.
>>> import numpy as np
>>> element = np.ma.array([1, 2, 3, 4, 5, 6])
>>> test_elements = [0, 2]
>>> np.ma.isin(element, test_elements)
masked_array(data=[False, True, False, False, False, False],
mask=False,
fill_value=True)
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.ma.isin.html