Python Practice › NumPy Programs › Program 11

Element-wise less than

EasyNumPy Programs · 11 of 100

Write a NumPy program for an element-wise “less than” comparison.

Advertisement
Input
[6, 4], [2, 9]
Output
[False  True]

Approach

  1. np.less.

Solution

Python
import numpy as npprint(np.less([6, 4], [2, 9]))
Output
[False  True]
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More numpy programs

← All 100 NumPy Programs