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.ma as ma >>> a
(x, value, copy=True)
| 1974 | |
| 1975 | |
| 1976 | def masked_greater_equal(x, value, copy=True): |
| 1977 | """ |
| 1978 | Mask an array where greater than or equal to a given value. |
| 1979 | |
| 1980 | This function is a shortcut to ``masked_where``, with |
| 1981 | `condition` = (x >= value). |
| 1982 | |
| 1983 | See Also |
| 1984 | -------- |
| 1985 | masked_where : Mask where a condition is met. |
| 1986 | |
| 1987 | Examples |
| 1988 | -------- |
| 1989 | >>> import numpy.ma as ma |
| 1990 | >>> a = np.arange(4) |
| 1991 | >>> a |
| 1992 | array([0, 1, 2, 3]) |
| 1993 | >>> ma.masked_greater_equal(a, 2) |
| 1994 | masked_array(data=[0, 1, --, --], |
| 1995 | mask=[False, False, True, True], |
| 1996 | fill_value=999999) |
| 1997 | |
| 1998 | """ |
| 1999 | return masked_where(greater_equal(x, value), x, copy=copy) |
| 2000 | |
| 2001 | |
| 2002 | def masked_less(x, value, copy=True): |