Question: Given is a table orders with product orders, and a table customers with customer info. Merge the two tables together such that the remaining table
Given is a table orders with product orders, and a table customers with customer info. Merge the two tables together such that the remaining table only has orders for which customer info is available. Assign the final dataframe to the variable sales.
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"]})
B:
The customer ID of "Rahul Redford" is wrong, iit should be 5 not 6. Correct the ID and calculate the sum of the sales values for each city. Assign the resulting series with only the total amount of sales to the variable sales_city.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
