In this python numpy program, we will create an element-wise comparison using NumPy.
Steps to solve the program
- Import the numpy library as np.
- Create two arrays using np.array().
- Create an element-wise comparison greater than using ( > ).
- Print the output.
import numpy as np
x = np.array([8,3])
y = np.array([9,1])
print(x>y)
Output :
[False True]