1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Python

Exercise

Explore the baseball data

Because the mean and median are so far apart, you decide to complain to the MLB. They find the error and send the corrected data over to you. It's again available as a 2D NumPy array np_baseball, with three columns.

The Python script in the editor already includes code to print out informative messages with the different summary statistics. Can you finish the job? np_baseball is available.

Instructions

100 XP
  • The code to print out the mean height is already included. Complete the code for the median height. Replace None with the correct code.
  • Use np.std() on the first column of np_baseball to calculate stddev. Replace None with the correct code.
  • Do big players tend to be heavier? Use np.corrcoef() to store the correlation between the first and second column of np_baseball in corr. Replace None with the correct code.