In this python numpy program, we will check whether two arrays are element-wise equal using NumPy.
Steps to solve the program
- Import the numpy library as np.
- Create two arrays using np.array().
- Check whether two arrays are element-wise equal using equal to sign ( == ).
- Print the output.
import numpy as np
x = np.array([5, 3])
y = np.array([7,4])
print("Is two arrays element wise equal? : ",x == y)
Output :
Is two arrays element wise equal? : [False False]