Back to problems

Merge CSVs and build revenue pivot with pandas

Algorithm · Capital One · Medium

Write a Python/pandas pipeline that consumes four CSV files with the schemas shown below. Load them reliably: if reading one of the files fails once, retry that file, and if it fails again continue with an empty table that has the expected columns so the remaining steps do not crash. Compute order-level net revenue as total_amount - refund_amount. An order may not appear in refunds; in that case, treat refund_amount as 0. Map each order to its channel via orders.customer_id…

Checking your access…