LoslegenKostenlos loslegen

How much more do organic avocados cost?

Avocados are increasingly popular food, and no city in the United States consumes as many avocados as Los Angeles, California. At the same time, high demand for organic produce means that organic avocados cost more than their conventionally grown counterparts. In this exercise, you'll explore some historical data on the price of avocados in Los Angeles to gain some insight into the premium that people pay for organic avocados.

Two arrays, conventional and organic, are loaded that contain the month-by-month average price in USD of conventional and organic avocados in Los Angeles.

You'll use NumPy's mean(), min(), and max() functions to summarize these arrays and gain some insight into the premium cost of organic avocados in Los Angeles.

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.

# Calculate and print the average price conventional avocados
conventional_mean = ____.____(____)
print('Mean conventional price: ${:.2f}'.format(conventional_mean))
Code bearbeiten und ausführen