Session Ready
Exercise

Comparing with two KDEs

Imagine that you work for the premier air-filter provider. Your company has asked you to build a report that looks into why 2012 was a particularly good year for sales of your ozone (O3) filter. You downloaded some helpful pollution data from the USGS, and you want to make a concise visualization that compares the general pattern of O3 pollution for 2012 to all other years on record.

To do this, you can build two overlaid kernel density estimation plots (KDEs): one for 2012 O3 data and one for all other years.

Instructions
100 XP
  • Filter the data in the first sns.kdeplot() call to include only the year 2012.
  • Shade under the first KDE with the shade argument.
  • Add the label '2012' for the plot legend.
  • Repeat the first three steps for second sns.kdeplot() call, but filter the data to not include 2012. Use the label 'other years'.