Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
-Print out bmi.
'''
# height and weight are available as a regular lists
# height_in and weight_lb are available as regular lists

# Import numpy
import numpy as np

# Calculate the BMI: bmi
np_height_m = np.array(height) * 0.0254
np_weight_kg = np.array(weight) * 0.453592
bmi = np_weight_kg / np_height_m ** 2
# Create array from height_in with metric units: np_height_m
np_height_m = np.array(height_in) * 0.0254

# Create the light array
light = np.array(bmi < 21)
# Create array from weight_lb with metric units: np_weight_kg
np_weight_kg = np.array(weight_lb) * 0.453592

# Print out light
print(light)
# Calculate the BMI: bmi
bmi = np_weight_kg / np_height_m ** 2

# Print out BMIs of all baseball players whose BMI is below 21
print(bmi[light])
# Print out bmi
print(bmi)