MCPcopy
hub / github.com/numpy/numpy / masked_not_equal

Function masked_not_equal

numpy/ma/core.py:2116–2140  ·  view source on GitHub ↗

Mask an array where *not* equal to a given value. This function is a shortcut to ``masked_where``, with `condition` = (x != value). See Also -------- masked_where : Mask where a condition is met. Examples -------- >>> import numpy as np >>> import numpy.ma

(x, value, copy=True)

Source from the content-addressed store, hash-verified

2114
2115
2116def masked_not_equal(x, value, copy=True):
2117 """
2118 Mask an array where *not* equal to a given value.
2119
2120 This function is a shortcut to ``masked_where``, with
2121 `condition` = (x != value).
2122
2123 See Also
2124 --------
2125 masked_where : Mask where a condition is met.
2126
2127 Examples
2128 --------
2129 >>> import numpy as np
2130 >>> import numpy.ma as ma
2131 >>> a = np.arange(4)
2132 >>> a
2133 array([0, 1, 2, 3])
2134 >>> ma.masked_not_equal(a, 2)
2135 masked_array(data=[--, --, 2, --],
2136 mask=[ True, True, False, True],
2137 fill_value=999999)
2138
2139 """
2140 return masked_where(not_equal(x, value), x, copy=copy)
2141
2142
2143def masked_equal(x, value, copy=True):

Callers 4

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
not_equalFunction · 0.85

Tested by 4

test_testOddFeaturesMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…