Mask an array where less 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 >>> import n
(x, value, copy=True)
| 2087 | |
| 2088 | |
| 2089 | def masked_less_equal(x, value, copy=True): |
| 2090 | """ |
| 2091 | Mask an array where less than or equal to a given value. |
| 2092 | |
| 2093 | This function is a shortcut to ``masked_where``, with |
| 2094 | `condition` = (x <= value). |
| 2095 | |
| 2096 | See Also |
| 2097 | -------- |
| 2098 | masked_where : Mask where a condition is met. |
| 2099 | |
| 2100 | Examples |
| 2101 | -------- |
| 2102 | >>> import numpy as np |
| 2103 | >>> import numpy.ma as ma |
| 2104 | >>> a = np.arange(4) |
| 2105 | >>> a |
| 2106 | array([0, 1, 2, 3]) |
| 2107 | >>> ma.masked_less_equal(a, 2) |
| 2108 | masked_array(data=[--, --, --, 3], |
| 2109 | mask=[ True, True, True, False], |
| 2110 | fill_value=999999) |
| 2111 | |
| 2112 | """ |
| 2113 | return masked_where(less_equal(x, value), x, copy=copy) |
| 2114 | |
| 2115 | |
| 2116 | def masked_not_equal(x, value, copy=True): |
searching dependent graphs…