Session Ready
Exercise

Mean or median

As data scientists, we often look to describe data as concisely as possible. This brings us to the two most common measures of centrality: mean and median. In this exercise, you'll examine a couple different scenarios and decide which metric is optimal for effectively describing the data.

More concretely, you'll be exploring Australian weather data containing features related to temperature and wind speeds. This dataset has already been imported as weather and both the matplotlib and pandas packages have been imported as plt and pd for you to use the rest of the chapter as well.

Instructions 1/3
undefined XP
  • 1

    Plot the distribution of the Temp3pm column using the hist() function; is the data skewed at all?

    • 2

      Assign and print the mean and median for the Temp3pm column; which do you think is a better representation of the data?

    • 3

      Adapt the code to explore a different column; see how the results for Temp9am look.