[ Web Proxy ]
URL:
Viewing: https://numpy.org/doc/stable/reference/generated/../generated/numpy.ma.intersect1d.html [Back]  [Original]

numpy.ma.intersect1d — NumPy v2.5 Manual
Back to top
Search the docs ...:

numpy.ma.intersect1d#

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

Returns the unique elements common to both arrays.

Masked values are considered equal one to the other. The output is always a masked array.

See numpy.intersect1d for more details.

See also

numpy.intersect1d

Equivalent function for ndarrays.

Examples

Try it in your browser!
>>> import numpy as np
>>> x = np.ma.array([1, 3, 3, 3], mask=[0, 0, 0, 1])
>>> y = np.ma.array([3, 1, 1, 1], mask=[0, 0, 0, 1])
>>> np.ma.intersect1d(x, y)
masked_array(data=[1, 3, --],
             mask=[False, False,  True],
       fill_value=999999)

Web Proxy Viewer  |  New URL  |  Original Page