LoslegenKostenlos loslegen

Encoding data in color & size

In this exercise, you'll visualize the relationships between the prices of organic and conventional avocados.

The following NumPy arrays are in your workspace:

  • conventional_price contains the month-by-month average price of conventional avocados in numerous markets.
  • organic_price contains the same for organic avocados.
  • fraction_organic contains the fraction of avocados sold in the month that were organic.

You'll use matplotlib to try to answer a few questions and gain some insight into the market for organic avocados.

  • When conventional avocados cost more, do the prices go up on organic avocados, too?
  • When the premium for organic avocados is less, do people buy more organic avocados?

Diese Übung ist Teil des Kurses

Python for MATLAB Users

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Initialize the figure
plt.figure()

# Make the scatter plot


plt.show()
Code bearbeiten und ausführen