Back to Practice
#0101

Inner Join Users and Events

EasyPandas15 min10 XP

Problem

Given users and events DataFrames, return an inner join on user_id sorted by event_id.

Why This Matters

Joining tables correctly is one of the most common data-analysis tasks.

Function Signature

def join_known_user_events(users, events):

Examples

Example 1
Inputevents include user 99 not in users
Outputevent for user 99 removed

Inner join keeps only matching user ids.

Constraints

  • Return the exact structure requested.
  • Handle the edge cases mentioned in the prompt.
  • Prefer clear logic over clever one-liners.
CodePython
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
Inputevents include user 99 not in users
Expectedevent for user 99 removed

Inner join keeps only matching user ids.

Hidden Test Categories
all users knownno users knownmultiple events per user