Numpy arrays
height = [1.87, 1.87, 1.82, 1.91, 1.90, 1.97]
weight = [81.65, 97.52, 95.25, 92.98, 86.18, 82.65]
import numpy as np
np_height = np.array(height)
np_weight = np.array(weight)
bmi = np_weight / np_height ** 2
print(bmi>23) # returns boolean values
print(bmi[bmi>23]) # returns bmi with values > 23
Comments
Post a Comment
Write something to CodeWithAbdur!