AnalystPath

Third Fastest Marathon Time

PandasMediumMid level~10 min

Problem

A race organiser records each runner's finishing time in whole minutes.

**DataFrame: `race_finishes`**

| Column | Type |
|----------------|------|
| runner_id | int |
| finish_minutes | int |

`runner_id` is unique. A **faster** runner has a **smaller** `finish_minutes`.

Return a DataFrame with a single column `third_fastest` holding the **3rd fastest distinct** finishing time — that is, the 3rd smallest distinct value.

Input data

Example rows — the live problem includes the full dataset.

race_finishes
runner_idfinish_minutes
1188
2195
3210
4230

Expected output

Your answer should return 1 row with the columns third_fastest.

Starter code (Pandas (Python))

import pandas as pd

def third_fastest_time(race_finishes) -> pd.DataFrame:
    # Your code here
    return race_finishes

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