AnalystPath

Highest Unique Queue Ticket

PandasEasyJunior level~10 min

Problem

You are given a DataFrame `queue_tickets` with a single integer column `ticket_no`. The table may contain duplicate ticket numbers.

A ticket number is **unique** when it appears exactly once across the whole DataFrame. Return the largest such unique ticket number in a one-row, one-column DataFrame whose column is named `top_unique`. If no ticket number is unique, return a single row holding a missing value (`None`/`NaN`).

Input data

Example rows — the live problem includes the full dataset.

queue_tickets
ticket_no
40
40
15
15
7

Expected output

Your answer should return 1 row with the columns top_unique.

Starter code (Pandas (Python))

import pandas as pd

def highest_unique_queue_ticket(queue_tickets) -> pd.DataFrame:
    # Your code here
    return queue_tickets

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