Python Practice › NumPy Programs › Program 43

Element-wise equality

EasyNumPy Programs · 43 of 100

Write a NumPy program to check whether two arrays are equal element-wise.

Advertisement
Input
[5, 3], [7, 8]
Output
[False False]

Approach

  1. np.equal.

Solution

Python
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.

More numpy programs

← All 100 NumPy Programs

Leave a Comment