BMI

Calcolo del Body Mass Index a partire da 2 liste con i pesi e le altezze

import numpy as np

WEIGHT = [ 81.65, 97.52, 95.25, 92.98, 86.18, 88.45 ] # lista
HEIGHT = [  1.87,  1.87,  1.82,  1.91,  1.90,  1.85 ] # lista

weight = np.array(WEIGHT)   # numpy.ndarray
height = np.array(HEIGHT)   # numpy.ndarray
bmi    = weight/(height**2) # numpy.ndarray è forte!

print(bmi)
[23.34925219 27.88755755 28.75558507 25.48723993 23.87257618 25.84368152]

Seleziona i dati

print(bmi[bmi > 25]) 
[27.88755755 28.75558507 25.48723993 25.84368152]

Vedi: https://jobtensor.com/Tutorial/Python/en/NumPy