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

Function masked_greater

numpy/ma/core.py:1950–1973  ·  view source on GitHub ↗

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.ma as ma >>> a = np.arange(4

(x, value, copy=True)

Source from the content-addressed store, hash-verified

1948
1949
1950def masked_greater(x, value, copy=True):
1951 """
1952 Mask an array where greater than a given value.
1953
1954 This function is a shortcut to ``masked_where``, with
1955 `condition` = (x > value).
1956
1957 See Also
1958 --------
1959 masked_where : Mask where a condition is met.
1960
1961 Examples
1962 --------
1963 >>> import numpy.ma as ma
1964 >>> a = np.arange(4)
1965 >>> a
1966 array([0, 1, 2, 3])
1967 >>> ma.masked_greater(a, 2)
1968 masked_array(data=[0, 1, 2, --],
1969 mask=[False, False, False, True],
1970 fill_value=999999)
1971
1972 """
1973 return masked_where(greater(x, value), x, copy=copy)
1974
1975
1976def masked_greater_equal(x, value, copy=True):

Callers 2

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
greaterFunction · 0.50

Tested by 2

test_testOddFeaturesMethod · 0.72