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.__lshift__()
- Python | Numpy numpy.ndarray.__add__()
- Python | Numpy numpy.ndarray.__sub__()
- Python | Numpy numpy.ndarray.__imul__()
- Python | Numpy numpy.ndarray.__rshift__()
- Python | Numpy numpy.ndarray.__pow__()
- Python | Numpy numpy.ndarray.__floordiv__()
- Python | Numpy numpy.ndarray.__ge__()
- Python | Numpy numpy.ndarray.__mod__()
- Python | Numpy numpy.ndarray.__invert__()
- Python | Numpy numpy.ndarray.__divmod__()
- Python | Numpy numpy.ndarray.__lt__()
- Python | Numpy numpy.ndarray.__or__()
- Python | Numpy numpy.ndarray.__mul__()
- Python | Numpy numpy.ndarray.__pos__()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.