Practice / selecting and filtering

Long Visits

easy

PulsePoint gym wants to celebrate its most dedicated members — the ones who stay a while.

You have the checkins DataFrame:

Your task: return the member and minutes for every visit lasting at least 45 minutes.

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

checkinsinput DataFrame

Schema
columntype
checkin_idlong
memberstring
minuteslong
Sample rows
checkin_idmemberminutes
1Ada50
2Ben20
3Cara45
4Dan60
5Ada30
Expected output shape
memberminutes· 3 rows
Hint

filter(F.col("minutes") >= 45) then select("member", "minutes"). "At least 45" includes exactly 45, so it's >=, not >.

Lesson refresher

This problem builds on Selecting & Filtering (~6 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.