Introduction to NumPy

In [1]:
import numpy as np

a = np.array([6.0, 2.1, 8.2, 10.3, 5.4, 1.5, 7.6, 3.7, 9.8])
In [2]:
a[a < 5]
Out[2]:
array([2.1, 1.5, 3.7])
In [3]:
a[a >= 8.2]
Out[3]:
array([ 8.2, 10.3,  9.8])
In [4]:
a[a == 6.0]
Out[4]:
array([6.])