1. Learn
  2. /
  3. Courses
  4. /
  5. Improving Your Data Visualizations in Python

Connected

Exercise

Programmatically creating a highlight

You are continuing your work for the city of Houston. Now you want to look at the behavior of both NO2 and SO2 when the un-plotted ozone (O3) value was at its highest.

To do this, replace the logic in the current list comprehension with one that compares a row's O3 value with the highest observed O3 in the dataset. Note: use sns.scatterplot() instead of sns.regplot(). This is because sns.scatterplot() can take a non-color vector as its hue argument and colors the points automatically while providing a helpful legend.

Instructions

100 XP
  • Find the value corresponding to the highest observed O3 value in the houston_pollution DataFrame. Make sure to type the letter O and not the number zero!
  • Append the column 'point_type' to the houston_pollution DataFrame to mark if the row contains the highest observed O3.
  • Pass this newly created column to the hue argument of sns.scatterplot() to color the points.