MCPcopy
hub / github.com/numpy/numpy / masked_less_equal

Function masked_less_equal

numpy/ma/core.py:2089–2113  ·  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 as np >>> import n

(x, value, copy=True)

Source from the content-addressed store, hash-verified

2087
2088
2089def masked_less_equal(x, value, copy=True):
2090 """
2091 Mask an array where less than or equal to a given value.
2092
2093 This function is a shortcut to ``masked_where``, with
2094 `condition` = (x <= value).
2095
2096 See Also
2097 --------
2098 masked_where : Mask where a condition is met.
2099
2100 Examples
2101 --------
2102 >>> import numpy as np
2103 >>> import numpy.ma as ma
2104 >>> a = np.arange(4)
2105 >>> a
2106 array([0, 1, 2, 3])
2107 >>> ma.masked_less_equal(a, 2)
2108 masked_array(data=[--, --, --, 3],
2109 mask=[ True, True, True, False],
2110 fill_value=999999)
2111
2112 """
2113 return masked_where(less_equal(x, value), x, copy=copy)
2114
2115
2116def masked_not_equal(x, value, copy=True):

Callers 2

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
less_equalFunction · 0.85

Tested by 2

test_testOddFeaturesMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…