Back to Practice
#0185

Left Anti Join in Pandas

MediumPandas25 min20 XP

Problem

Given users and orders dataframes, return users who have no order.

Why This Matters

Anti-joins are useful for missing records, failed matches, and data-quality audits.

Function Signature

def users_without_orders(users, orders):

Examples

Example 1
Inputusers 1,2,3; orders for 1 and 3
Outputuser 2

Only user 2 has no matching order row.

Constraints

  • Return the exact requested result.
  • Handle common edge cases.
  • Keep the solution readable before optimizing.
CodePython
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
Inputusers 1,2,3; orders for 1 and 3
Expecteduser 2

Only user 2 has no matching order row.

Hidden Test Categories
minimal inputrepeated valueslarger realistic input