MCPcopy Create free account
hub / github.com/numpy/numpy / masked_less

Function masked_less

numpy/ma/core.py:2002–2025  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2000
2001
2002def 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
2028def masked_less_equal(x, value, copy=True):

Callers 2

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
lessFunction · 0.50

Tested by 2

test_testOddFeaturesMethod · 0.72