Back to problems

Manipulate and merge DataFrames correctly

Algorithm · Boston Consulting Group · Hard

You are given three pandas DataFrames. customers: products: orders: Write idiomatic, vectorized pandas code that takes these three DataFrames and performs the following tasks: (a) Filter to completed orders, then add revenue = qty * unit_price and drop the status column. (b) Merge the orders with products and with customers. Use the keys model_id (order to product, one-to-one) and customer_id (order to customer, many-to-one), and enforce merge validation so that duplicate…

Checking your access…