Test whether two arrays are element-wise equal using NumPy.

In this python numpy program,we will test whether two arrays are element-wise equal using NumPy.

Steps to solve the program
  1. Import the numpy library as np.
  2. Create two arrays using np.array().
  3. Test whether two arrays are element-wise equal using equal to (==).
  4. 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]
				
			

test whether a number is scalar or not.

create an element-wise comparison (greater than).

Leave a Comment