datacamp-data-analyst-with-python icon indicating copy to clipboard operation
datacamp-data-analyst-with-python copied to clipboard

Price of conventional vs. organic avocados

Open Ramzan-Ali12 opened this issue 10 months ago • 0 comments

The Correct code for this exercise is

Histogram of conventional avg_price

avocados[avocados["type"] == "conventional"]["avg_price"].hist()

Histogram of organic avg_price

avocados[avocados["type"] == "organic"]["avg_price"].hist()

Add a legend

plt.legend(["conventional", "organic"])

Show the plot

plt.show()

Ramzan-Ali12 avatar Aug 19 '23 18:08 Ramzan-Ali12