Session Ready
Exercise

Annotating confidence intervals

Your data science work with pollution data is legendary, and you are now weighing job offers in both Cincinnati, Ohio and Indianapolis, Indiana. You want to see if the SO2 levels are significantly different in the two cities, and more specifically, which city has lower levels. To test this, you decide to look at the differences in the cities' SO2 values (Indianapolis' - Cincinnati's) over multiple years (provided as diffs_by_year).

Instead of just displaying a p-value for a significant difference between the cities, you decide to look at the 95% confidence intervals (columns lower and upper) of the differences. This allows you to see the magnitude of the differences along with any trends over the years.

Instructions
100 XP
  • Provide starting and ending limits (columns lower and upper) for your confidence intervals to plt.hlines().
  • Set interval thickness to 5.
  • Draw a vertical line representing a difference of 0 with plt.axvline().
  • Color the null line 'orangered' to make it stand out.