Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Python for MATLAB Users

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Calculate and print the average price conventional avocados
conventional_mean = ____.____(____)
print('Mean conventional price: ${:.2f}'.format(conventional_mean))
Code bewerken en uitvoeren