Top Issue Tags in a Support Queue
Problem
A DataFrame `supportnotes` logs help-desk replies. Each `note_body` contains exactly one square-bracketed tag, for example `[BILLING]` or `[LOGIN]`, marking the topic of the reply. Find the three most-used tags among notes written in March 2025 (note_date from 2025-03-01 to 2025-03-31 inclusive). Return a DataFrame with columns `issue_tag` (the tag text including its brackets, e.g. `[BILLING]`) and `tag_total` (how many March notes carried it), ordered by `tag_total` descending and then by `issue_tag` descending, keeping only the top three.
Input data
Example rows — the live problem includes the full dataset.
| agent_id | note_id | note_date | note_body |
|---|---|---|---|
| 51 | 9001 | 2025-03-02 | Refund processed [BILLING] |
| 52 | 9002 | 2025-03-04 | Card declined again [BILLING] |
| 53 | 9003 | 2025-03-05 | Reset the password [LOGIN] |
| 54 | 9004 | 2025-03-07 | App keeps crashing [BUG] |
| 55 | 9005 | 2025-03-09 | Invoice mismatch [BILLING] |
Expected output
Your answer should return 3 rows with the columns issue_tag, tag_total.
Starter code (Pandas (Python))
import pandas as pd
def top_issue_tags(supportnotes) -> pd.DataFrame:
# Your code here
return supportnotesSolve 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