| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../generated/numpy.ma.in1d.html | [Back] [Original] |
Section Navigation
Test whether each element of an array is also present in a second array.
The output is always a masked array.
We recommend using isin instead of in1d for new code.
See also
isinVersion of this function that preserves the shape of ar1.
Examples
>>> import numpy as np
>>> ar1 = np.ma.array([0, 1, 2, 5, 0])
>>> ar2 = [0, 2]
>>> np.ma.in1d(ar1, ar2)
masked_array(data=[ True, False, True, False, True],
mask=False,
fill_value=True)
Copyright 2008-2026, NumPy Developers.
Created using Sphinx 7.2.6.
Built with the PyData Sphinx Theme 0.17.1.
| Web Proxy Viewer | New URL | Original Page |