Keep the First Email Record

Each record has name and email. Remove duplicate email addresses with Pandas, keeping the first record for each email in original row order. Compare email strings exactly, including case. Return a list of dictionaries with name and email. Empty input returns an empty list.

Difficulty: beginner

Show hint

Use drop_duplicates(subset=["email"], keep="first"). Duplicates depend on email, even when the names differ.

Examples

Your solution

Python · Pandas

Results

Python and Pandas load when you Run or Submit. Return a Python list, dictionary or scalar as requested.

Back to Lesson