Hi everyone, I’m finishing up the introductory module of Learn Statistics with NumPy and working through the project “Betty’s Bakery.”
The program let me pass with the following code, but it still brings up an error in the console and won’t print my grocery list out correctly.
import numpy as np # numpy has to be lowercase cupcakes = ([2, 0.75, 2, 1, 0.5]) recipes = np.genfromtxt('recipes.csv', delimiter=',') print recipes eggs = recipes[:,2] one_egg = recipes[(eggs == 1)] print one_egg cookies = recipes[2,:] double_batch = cupcakes * 2 # 2 batches of cupcakes grocery_list = cookies + double_batch print grocery_list
Also, I checked the video walkthrough and my code is identical, so I don’t know why I get this error message in the console:
Traceback (most recent call last): File "script.py", line 14, in <module> grocery_list = double_batch + cookies ValueError: operands could not be broadcast together with shapes (10,) (5,)
I’m a total newb so any insight would be appreciated.