Mask an array where greater 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.ma as ma >>> a = np.arange(4
(x, value, copy=True)
| 1948 | |
| 1949 | |
| 1950 | def masked_greater(x, value, copy=True): |
| 1951 | """ |
| 1952 | Mask an array where greater than a given value. |
| 1953 | |
| 1954 | This function is a shortcut to ``masked_where``, with |
| 1955 | `condition` = (x > value). |
| 1956 | |
| 1957 | See Also |
| 1958 | -------- |
| 1959 | masked_where : Mask where a condition is met. |
| 1960 | |
| 1961 | Examples |
| 1962 | -------- |
| 1963 | >>> import numpy.ma as ma |
| 1964 | >>> a = np.arange(4) |
| 1965 | >>> a |
| 1966 | array([0, 1, 2, 3]) |
| 1967 | >>> ma.masked_greater(a, 2) |
| 1968 | masked_array(data=[0, 1, 2, --], |
| 1969 | mask=[False, False, False, True], |
| 1970 | fill_value=999999) |
| 1971 | |
| 1972 | """ |
| 1973 | return masked_where(greater(x, value), x, copy=copy) |
| 1974 | |
| 1975 | |
| 1976 | def masked_greater_equal(x, value, copy=True): |