Mask an array where less 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)
| 2000 | |
| 2001 | |
| 2002 | def masked_less(x, value, copy=True): |
| 2003 | """ |
| 2004 | Mask an array where less than a given value. |
| 2005 | |
| 2006 | This function is a shortcut to ``masked_where``, with |
| 2007 | `condition` = (x < value). |
| 2008 | |
| 2009 | See Also |
| 2010 | -------- |
| 2011 | masked_where : Mask where a condition is met. |
| 2012 | |
| 2013 | Examples |
| 2014 | -------- |
| 2015 | >>> import numpy.ma as ma |
| 2016 | >>> a = np.arange(4) |
| 2017 | >>> a |
| 2018 | array([0, 1, 2, 3]) |
| 2019 | >>> ma.masked_less(a, 2) |
| 2020 | masked_array(data=[--, --, 2, 3], |
| 2021 | mask=[ True, True, False, False], |
| 2022 | fill_value=999999) |
| 2023 | |
| 2024 | """ |
| 2025 | return masked_where(less(x, value), x, copy=copy) |
| 2026 | |
| 2027 | |
| 2028 | def masked_less_equal(x, value, copy=True): |