I have just finished the NumPy lesson in the Data Science Path. I have a question from doing Betty’s Bakery Project. I did it well overall, but I need to know how to insert the values from a np.array into a new CSV file?
In the exercise (no.9), we have an array of grocery list (Flour, Sugar, Eggs, Milk, Butter) from this code:
cookies = recipes[2,:] print(cookies) # [ 2.75 1.5 1. 0. 1. ] double_batch_cupcakes = cupcakes * 2 print(double_batch_cupcakes) #[ 4. 1.5 4. 2. 1. ] grocery_list = double_batch_cupcakes + cookies print(grocery_list) #[ 6.75 3. 5. 2. 2. ]
So this grocery list is the number of ingredients that Betty needs to buy to make a double batch of cupcakes and a single batch of cookies. Now from this point, how do I enter this number in a CSV file or a data frame so that Betty can print it and take it with her when she goes to the supermarket ?
Will appreciate any pointers I can get.