In this python numpy program,we will test 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().
- Test whether two arrays are element-wise equal using equal to (==).
- Print the output.
import numpy as np
x = np.array([3,8,5])
y = np.array([3,8,5])
print(x==y)
Output :
[ True True True]