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 as np >>> import numpy.ma as
(x, value, copy=True)
| 2006 | |
| 2007 | |
| 2008 | def masked_greater(x, value, copy=True): |
| 2009 | """ |
| 2010 | Mask an array where greater than a given value. |
| 2011 | |
| 2012 | This function is a shortcut to ``masked_where``, with |
| 2013 | `condition` = (x > value). |
| 2014 | |
| 2015 | See Also |
| 2016 | -------- |
| 2017 | masked_where : Mask where a condition is met. |
| 2018 | |
| 2019 | Examples |
| 2020 | -------- |
| 2021 | >>> import numpy as np |
| 2022 | >>> import numpy.ma as ma |
| 2023 | >>> a = np.arange(4) |
| 2024 | >>> a |
| 2025 | array([0, 1, 2, 3]) |
| 2026 | >>> ma.masked_greater(a, 2) |
| 2027 | masked_array(data=[0, 1, 2, --], |
| 2028 | mask=[False, False, False, True], |
| 2029 | fill_value=999999) |
| 2030 | |
| 2031 | """ |
| 2032 | return masked_where(greater(x, value), x, copy=copy) |
| 2033 | |
| 2034 | |
| 2035 | def masked_greater_equal(x, value, copy=True): |
searching dependent graphs…