562 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
The above folder contains a spreadsheet analysing how many ingredients you buy for your modest pancake stall (Wise Owl are Crepe) in a typical week:
You have lots of supplies of cooking oil and salt in stock, so don't need these.
Create a program called Business Plan.py, and type in the following code (you'll need to change the folder path given):
import pandas as pd
import numpy as np
# read excel into Pandas data frame
temp_df = pd.read_excel('C:\wiseowl\Python\purchases.xlsx')
# convert a data frame to a Numpy 2D array
purchases = np.asarray(temp_df)
This should import the data from the Excel workbook, and convert it (via a Pandas dataframe) to a NumPy array. Print the array to check that this has worked:
Print out the dtype property of the array also to show that the presence of the first column is forcing Python to store the data as type object.
Use slicing to set the value of a new variable called volumes equal to the array above, but minus its first column, then run the following command to convert this array to data type integer:
new_volumes = volumes.astype('I')
Print out the dtype property of this latest array to check that the data is indeed now being held as integers.
Create another array called prices to hold the prices you pay in pounds:
Price you pay
Show the shape of each of your two arrays:
This should tell you which order they should go in when you mutliply them together.
Use the dot method to multiply your prices array by your new_volumes array to show your total spending per day, then use the sum method to show your total overall spending:
Your spending is peaking on Friday.
Save your program and close it down (if it's anywhere near lunchtime, maybe it's time to reward yourself with a pancake?).
25 Aytoun Street