BuildlyBuildly
DashboardExercisesProfileHelp
Data Science/Module 2: Data Analytics/Merge & Concat3/3
Exercise·7 min·10 XP

Left Join with Fallback Value

Context. Stack of orders, but the customer table doesn't have every customer. Keep all orders; fill missing names with "Unknown".

Your task. Write attach_or_unknown(orders, customers) that left-joins on customer_id and replaces missing names with "Unknown".

Example. orders for customers 10, 20, 30; customers has only 10, 20 → 3 rows, with name="Unknown" for the order with customer 30.

Notes. Same row order as orders. Every order matched → no "Unknown" substitution.

Previous
Inner Join Two Tables
Next
Stack DataFrames Vertically