Long Sessions

Easy
Filtering
Adobe

Long Sessions

Given a sessions DataFrame, return rows where duration_sec > 600. Project the columns session_id, user_id, duration_sec and order by session_id ascending.

Sample input sessions

session_iduser_idduration_secplatform
50083352Android
5018819Web
502161457Web
5031115Android
504161062iOS
505201411Android
Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.sessions10 rows
session_id (int)user_id (int)duration_sec (int)platform (string)
50083352Android
5018819Web
502161457Web
5031115Android
504161062iOS
505201411Android
506121494iOS
5078419iOS
50816806Android
50971977Web

Return these columns

session_id(int)
user_id(int)
duration_sec(int)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.