1. Learn
  2. /
  3. Courses
  4. /
  5. Data Manipulation with pandas

Connected

Exercise

Price of conventional vs. organic avocados

Creating multiple plots for different subsets of data allows you to compare groups. In this exercise, you'll create multiple histograms to compare the prices of conventional and organic avocados.

matplotlib.pyplot has been imported as plt and pandas has been imported as pd.

Instructions 1/3

undefined XP
    1
    2
    3
  • Subset avocados for the "conventional" type and create a histogram of the avg_price column.
  • Create a histogram of avg_price for "organic" type avocados.
  • Add a legend to your plot, with the names "conventional" and "organic".
  • Show your plot.