MCPcopy Create free account
hub / github.com/numpy/numpy / masked_less_equal

Function masked_less_equal

numpy/ma/core.py:2028–2051  ·  view source on GitHub ↗

Mask an array where less than or 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.ma as ma >>> a = n

(x, value, copy=True)

Source from the content-addressed store, hash-verified

2026
2027
2028def masked_less_equal(x, value, copy=True):
2029 """
2030 Mask an array where less than or equal to a given value.
2031
2032 This function is a shortcut to ``masked_where``, with
2033 `condition` = (x <= value).
2034
2035 See Also
2036 --------
2037 masked_where : Mask where a condition is met.
2038
2039 Examples
2040 --------
2041 >>> import numpy.ma as ma
2042 >>> a = np.arange(4)
2043 >>> a
2044 array([0, 1, 2, 3])
2045 >>> ma.masked_less_equal(a, 2)
2046 masked_array(data=[--, --, --, 3],
2047 mask=[ True, True, True, False],
2048 fill_value=999999)
2049
2050 """
2051 return masked_where(less_equal(x, value), x, copy=copy)
2052
2053
2054def masked_not_equal(x, value, copy=True):

Callers 2

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
less_equalFunction · 0.50

Tested by 2

test_testOddFeaturesMethod · 0.72