Question: Question 4 ( 1 5 pts ) : Given below is a code to extract the fifth column ( Height ( inches ) ) and

Question 4(15 pts):
Given below is a code to extract the fifth column (Height (inches)) and the last column (Weight (lbs)) of the nfl DataFrame as two numpy arrays named np_height_in and np _weight_lb. Using the two numpy arrays, write your code to complete the following tasks.
Multiply np_height_in by 0.0254 to convert all height measurements from inches to meters. Store the new values in a new array, np_height_m .
Multiply np_weight_lb by 0.453592 to go from pounds to kilograms. Store the resulting numpy array as np_weight_kg .
Use np_height_m and np_weight_kg to calculate the BMI of each player. Use the following equation:
BMI=weight(kg)height(m)2
Store the resulting numpy array as bmi .
]):}):}
npheightin=np.array(nfl.iloc[:,4].values)
npweightlb=[np.array(nfl.iloc[:,-1]*values)
Question 4 ( 1 5 pts ) : Given below is a code to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!