NumPy program to create an element-wise comparison using NumPy.

In this python numpy program, we will create an element-wise comparison using NumPy.

Steps to solve the program
  1. Import the numpy library as np.
  2. Create two arrays using np.array().
  3. Create an element-wise comparison greater than using ( > ).
  4. Print the output.
				
					import numpy as np
x = np.array([8,3])
y = np.array([9,1])

print(x>y)
				
			

Output :

				
					[False  True]
				
			

test whether two arrays are element-wise equal.

create an element-wise comparison (greater equal).

Leave a Comment