AnalystPath

Supplier With the Most Deliveries

PandasEasyJunior level~10 min

Problem

DataFrame: `delivery` (`delivery.csv`)

```text
+--------------+-------------+
| Column | Type |
+--------------+-------------+
| delivery_ref | int |
| supplier_id | int |
+--------------+-------------+
delivery_ref uniquely identifies each delivery. Each row records one delivery made by a supplier.
```

Find the `supplier_id` that made the **largest number of deliveries**. The data is arranged so that exactly one supplier has strictly more deliveries than any other.

**Example**

Input — `delivery`:

```text
delivery_ref supplier_id
1 11
2 22
3 33
4 33
```

Output:

```text
supplier_id
33
```

Supplier 33 made two deliveries, more than any other supplier.

Input data

Example rows — the live problem includes the full dataset.

delivery
delivery_refsupplier_id
111
222
333
433

Expected output

Your answer should return 1 row with the columns supplier_id.

Starter code (Pandas (Python))

import pandas as pd

def top_supplier(delivery: pd.DataFrame) -> pd.DataFrame:
    # Your code here
    return delivery

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