With the help of numpy.ndarray.__gt__() method of Numpy, We can find that which element in an array is greater then the value which is provided in the parameter. It will return you numpy array with boolean type having only values True and False.
Syntax: ndarray.__gt__($self, value, /)
Example #1 :
In this example we can see that after applying
numpy.__gt__(), we get the simple boolean array that can tell us which element in an array is greater than that of provided parameter.
[False False False True True True]
Example #2 :
[[False False False False True True] [True True False False False False]]
- Python | Numpy numpy.ndarray.__and__()
- Python | Numpy numpy.ndarray.__pos__()
- Python | Numpy numpy.ndarray.__lt__()
- Python | Numpy numpy.ndarray.__xor__()
- Python | Numpy numpy.ndarray.__iadd__()
- Python | Numpy numpy.ndarray.__mul__()
- Python | Numpy numpy.ndarray.__imul__()
- Python | Numpy numpy.ndarray.__truediv__()
- Python | Numpy numpy.ndarray.__ge__()
- Python | Numpy numpy.ndarray.__eq__()
- Python | Numpy numpy.ndarray.__mod__()
- Python | Numpy numpy.ndarray.__divmod__()
- Python | Numpy numpy.ndarray.__ne__()
- Python | Numpy numpy.ndarray.__floordiv__()
- Python | Numpy numpy.ndarray.__neg__()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.