MCPcopy Index your code
hub / github.com/numpy/numpy / masked_greater

Function masked_greater

numpy/ma/core.py:2008–2032  ·  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 as np >>> import numpy.ma as

(x, value, copy=True)

Source from the content-addressed store, hash-verified

2006
2007
2008def 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
2035def masked_greater_equal(x, value, copy=True):

Callers 2

test_testOddFeaturesMethod · 0.90

Calls 2

masked_whereFunction · 0.85
greaterFunction · 0.85

Tested by 2

test_testOddFeaturesMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…