AnalystPath

Uninterrupted Study Sessions

PandasEasyJunior level~10 min

Problem

A focus app gives you two DataFrames. `studysession` has columns `session_id`, `user_id`, `start_min`, `end_min` (minute offsets within a day). `ping` has columns `ping_id`, `user_id`, `at_min` (the minute a notification fired).

Report the `session_id` of every study session during which the **same user** received **no** ping. A ping interrupts a session if it fired at any minute from `start_min` to `end_min`, inclusive.

Return a single column `session_id` in any order.

Input data

Example rows — the live problem includes the full dataset.

studysession
session_iduser_idstart_minend_min
1115
211523
321012
421728
512213
ping
ping_iduser_idat_min
115
2217
31220

Expected output

Your answer should return 3 rows with the columns session_id.

Starter code (Pandas (Python))

import pandas as pd

def uninterrupted_study_sessions(studysession, ping) -> pd.DataFrame:
    # Your code here
    return studysession

Solve this Pandas question free

Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related Pandas questions