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)
print(bmi>23) # returns boolean values
print(bmi[bmi>23]) # returns bmi with values > 23



Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes