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

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

numpy.ma.setdiff1d#

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

Set difference of 1D arrays with unique elements.

The output is always a masked array. See numpy.setdiff1d for more details.

See also

numpy.setdiff1d

Equivalent function for ndarrays.

Examples

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

Web Proxy Viewer  |  New URL  |  Original Page