Python Practice › NumPy Programs › Program 11
Element-wise less than
Write a NumPy program for an element-wise “less than” comparison.
Input
[6, 4], [2, 9]
Output
[False True]
Approach
np.less.
Solution
import numpy as npprint(np.less([6, 4], [2, 9]))Output
[False True]
Learn the concept
New to this topic? Read the lesson, then come back.