Question: Using the below sales dataframe answer the question A. orders = pd.DataFrame({'OrderID' : [1, 2, 3, 4, 5, 6, 7], 'CustID' : [1, 4, 3,

Using the below sales dataframe answer the question A.

orders = pd.DataFrame({'OrderID' : [1, 2, 3, 4, 5, 6, 7], 'CustID' : [1, 4, 3, 4, 1, 4, 5], 'Amount' : [20.20, 22.30, 12.93, 5.92, 16.12, 39.60, 4.5]})

customers = pd.DataFrame({'ID' : [1, 2, 3, 4, 6], 'First' : ["Henry", "Peter", "Jorijn", "Mike", "Rahul"], 'Last' : ["Jans", "Pomps", "Mule", "Haag", "Redford"], 'City' : ["Berlin", "Paris", "Frankfurt", "Berlin", "Hanover"]})

sales = pd.merge(orders, customers, left_on='CustID', right_on='ID')

A. create a new dataframe with as first column the first name (First) and the second column the sales amount (Amount). Assign this to the variable new_sales. Then calculate the total sales amount per person and assign that to the variable person. Create a bar plot of the resulting dataframe.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!