Session Ready
Exercise

Pearson correlation

In this exercise, you will be using the Olympic athletes dataset and focusing on just one event, the men's 100 meter running race. The dataset is provided in your workspace as athletes. You're going to be looking at how the weights of competitors have changed over time. A Pearson correlation test allows us to determine whether a linear relationship exists between two variables. pandas, scipy.stats, and plotnine have been loaded into the workspace as pd, stats, and p9, respectively. First, you'll make some plots, then you'll see how the sprinters' weights have changed over time.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Using geom_point(), create and print a scatter plot of Weight (y-axis) in relation to Year (x-axis), with a different color according to Event, using the athletes DataFrame.