MCPcopy
hub / github.com/numpy/numpy / masked_less

Function masked_less

numpy/ma/core.py:2062–2086  ·  view source on GitHub ↗

Mask an array where less than 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 as ma

(x, value, copy=True)

Source from the content-addressed store, hash-verified

2060
2061
2062def masked_less(x, value, copy=True):
2063 """
2064 Mask an array where less than a given value.
2065
2066 This function is a shortcut to ``masked_where``, with
2067 `condition` = (x < value).
2068
2069 See Also
2070 --------
2071 masked_where : Mask where a condition is met.
2072
2073 Examples
2074 --------
2075 >>> import numpy as np
2076 >>> import numpy.ma as ma
2077 >>> a = np.arange(4)
2078 >>> a
2079 array([0, 1, 2, 3])
2080 >>> ma.masked_less(a, 2)
2081 masked_array(data=[--, --, 2, 3],
2082 mask=[ True, True, False, False],
2083 fill_value=999999)
2084
2085 """
2086 return masked_where(less(x, value), x, copy=copy)
2087
2088
2089def masked_less_equal(x, value, copy=True):

Callers 2

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
lessFunction · 0.85

Tested by 2

test_testOddFeaturesMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…