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

Function masked_greater_equal

numpy/ma/core.py:1976–1999  ·  view source on GitHub ↗

Mask an array where greater 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.ma as ma >>> a

(x, value, copy=True)

Source from the content-addressed store, hash-verified

1974
1975
1976def masked_greater_equal(x, value, copy=True):
1977 """
1978 Mask an array where greater than or equal to a given value.
1979
1980 This function is a shortcut to ``masked_where``, with
1981 `condition` = (x >= value).
1982
1983 See Also
1984 --------
1985 masked_where : Mask where a condition is met.
1986
1987 Examples
1988 --------
1989 >>> import numpy.ma as ma
1990 >>> a = np.arange(4)
1991 >>> a
1992 array([0, 1, 2, 3])
1993 >>> ma.masked_greater_equal(a, 2)
1994 masked_array(data=[0, 1, --, --],
1995 mask=[False, False, True, True],
1996 fill_value=999999)
1997
1998 """
1999 return masked_where(greater_equal(x, value), x, copy=copy)
2000
2001
2002def masked_less(x, value, copy=True):

Callers 2

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
greater_equalFunction · 0.50

Tested by 2

test_testOddFeaturesMethod · 0.72