Mask an array where greater 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 >>> impor
(x, value, copy=True)
| 2033 | |
| 2034 | |
| 2035 | def masked_greater_equal(x, value, copy=True): |
| 2036 | """ |
| 2037 | Mask an array where greater than or equal to a given value. |
| 2038 | |
| 2039 | This function is a shortcut to ``masked_where``, with |
| 2040 | `condition` = (x >= value). |
| 2041 | |
| 2042 | See Also |
| 2043 | -------- |
| 2044 | masked_where : Mask where a condition is met. |
| 2045 | |
| 2046 | Examples |
| 2047 | -------- |
| 2048 | >>> import numpy as np |
| 2049 | >>> import numpy.ma as ma |
| 2050 | >>> a = np.arange(4) |
| 2051 | >>> a |
| 2052 | array([0, 1, 2, 3]) |
| 2053 | >>> ma.masked_greater_equal(a, 2) |
| 2054 | masked_array(data=[0, 1, --, --], |
| 2055 | mask=[False, False, True, True], |
| 2056 | fill_value=999999) |
| 2057 | |
| 2058 | """ |
| 2059 | return masked_where(greater_equal(x, value), x, copy=copy) |
| 2060 | |
| 2061 | |
| 2062 | def masked_less(x, value, copy=True): |
searching dependent graphs…