Practice / reshaping

Unique Listeners

easy

Waveform wants the set of listeners who played anything today — each user once, no matter how many tracks they played.

plays

Your task: return the distinct user_id values — one row per unique user, no duplicates.

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

playsinput DataFrame

Schema
columntype
play_idlong
user_idlong
track_idlong
Sample rows
play_iduser_idtrack_id
17100
27101
312100
412100
530205
67205
Expected output shape
user_id· 3 rows
Hint

Narrow to the one column first, THEN dedupe: plays.select("user_id").distinct(). Distinct works on whole rows, so select before you dedupe.

Lesson refresher

This problem builds on Reshaping Data (~7 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.