Format the Conference Badge Label
Problem
You are given a DataFrame `attendee` with columns `attendee_id`, `full_name`, and `department`.
Build a badge label for every attendee: the attendee's full name followed by the first letter of their `department` in parentheses, for example 'Harper(M)' for someone in Marketing. The case of that first letter is kept as-is.
Return two columns, `attendee_id` and `label`, ordered by `attendee_id` from highest to lowest.
Input data
Example rows — the live problem includes the full dataset.
| attendee_id | full_name | department |
|---|---|---|
| 1 | Harper | Sales |
| 3 | Quinn | Analytics |
| 2 | Reyes | Product |
| 4 | Soto | Design |
| 6 | Vance | Engineering |
Expected output
Your answer should return 6 rows with the columns attendee_id, label.
Starter code (Pandas (Python))
import pandas as pd
def format_conference_badge_label(attendee) -> pd.DataFrame:
# Your code here
return attendeeSolve 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