AnalystPath

Attendees By Track

PandasHardSenior level~10 min

Problem

You are given a DataFrame `attendee` with columns `attendee_name` and `track`, where every row records one conference attendee and the track they signed up for.

Reshape the data into three columns named exactly `Design`, `Backend`, and `Mobile`. Within each column, list that track's attendee names sorted alphabetically (A to Z). Because the three tracks may hold different numbers of people, line the names up row by row: the first name of every track shares the first row, the second name of every track shares the second row, and so on. When a track runs out of names while others still have more, fill the empty cells with a missing value (`None`/`NaN`).

Input data

Example rows — the live problem includes the full dataset.

attendee
attendee_nametrack
NadiaDesign
FelixMobile
WeiBackend
BrianDesign

Expected output

Your answer should return 2 rows with the columns Design, Backend, Mobile.

Starter code (Pandas (Python))

import pandas as pd

def attendees_by_track(attendee) -> pd.DataFrame:
    # Your code here
    return attendee

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