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)
| 2060 | |
| 2061 | |
| 2062 | def 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 | |
| 2089 | def masked_less_equal(x, value, copy=True): |
searching dependent graphs…