Python Practice › NumPy Programs › Program 43
Element-wise equality
Write a NumPy program to check whether two arrays are equal element-wise.
Input
[5, 3], [7, 8]
Output
[False False]
Approach
np.equal.
Solution
import numpy as npprint(np.equal([5, 3], [7, 8]))Output
[False False]
Learn the concept
New to this topic? Read the lesson, then come back.