Practice / joins

Ghosted Customers

medium

The Daily Grind's marketing team wants to win back customers who signed up but never actually ordered anything.

You have two DataFrames:

customers

orders

Your task: return the customer_id and name of every customer who has no matching row in orders.

Assign your answer DataFrame to result. Row order doesn't matter.

customersinput DataFrame

Schema
columntype
customer_idlong
namestring
Sample rows
customer_idname
100Priya
101Sam
102Wei
103Nadia

ordersinput DataFrame

Schema
columntype
order_idlong
customer_idlong
Sample rows
order_idcustomer_id
1100
2100
3101
Expected output shape
customer_idname· 2 rows
Hint

A left_anti join keeps left rows with no match on the right — exactly the customers who never ordered: customers.join(orders, on="customer_id", how="left_anti").

Lesson refresher

This problem builds on Joins (~8 min). Pop it open in a new tab if you want a quick recap.

Loading editor…
Hit Run to execute your code and see the output here.