MLS-C01 Exploratory Data Analysis Practice Question
A data engineer is building a data pipeline that aggregates customer transaction data. The engineer notices that some transactions have duplicate entries due to a system error. Which approach should the engineer use to identify and remove duplicates based on a unique transaction ID?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use the drop_duplicates method on the transaction ID column
Using drop_duplicates on the transaction ID column is a straightforward and efficient method to remove duplicate rows based on the unique identifier. Option A is incorrect; sorting and checking consecutive rows is a valid but more complex approach, and not as direct as drop_duplicates. Option B is incorrect because fuzzy matching is designed for approximate matches, not exact duplicates. Option C is incorrect because grouping by all columns and summing would aggregate data, potentially losing information, and does not specifically remove duplicate transaction IDs.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Sort the data by transaction ID and then check consecutive rows for equality
Why it's wrong here
Sorting data by transaction ID and checking consecutive rows only identifies adjacent duplicates. This approach itself lacks the mechanism to *remove* duplicates efficiently, as it doesn't specify which instance to keep or how to eliminate others across the entire dataset. De-duplication requires a method like `DISTINCT` or a window function (e.g., `ROW_NUMBER()`) to select a single record per unique ID. It is tempting because sorting is often the first step in preparing data for analysis or de-duplication, and would be suitable for simply *flagging* duplicates for manual review or as a preliminary step before applying a more robust de-duplication technique.
- ✗
Use fuzzy matching to find similar transaction IDs
Why it's wrong here
Fuzzy matching is for near duplicates, not exact duplicates.
- ✗
Group by all columns and aggregate with sum
Why it's wrong here
This could incorrectly aggregate non-duplicate rows.
- ✓
Use the drop_duplicates method on the transaction ID column
Why this is correct
drop_duplicates removes exact duplicate rows based on specified columns.
Go deeper
Related to this question
About these practice questions
One of 1,672 original MLS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.