Courseiva
Exploratory Data AnalysiseasyMultiple ChoiceObjective-mapped

MLS-C01 Exploratory Data Analysis Practice Question

A data scientist is analyzing a dataset of online retail transactions. The dataset contains 500,000 rows and 10 columns: 'TransactionID', 'CustomerID', 'ProductID', 'Quantity', 'UnitPrice', 'TransactionDate', 'PaymentMethod', 'ShippingAddress', 'Country', and 'TotalAmount'. The data scientist loads the data into a SageMaker notebook and performs initial EDA. The data scientist finds that 'UnitPrice' has a range from $0.01 to $10,000, with a mean of $50 and a median of $20. 'Quantity' ranges from -10 to 100, with negative values indicating returns. 'TotalAmount' is calculated as Quantity * UnitPrice. The data scientist also notices that 2% of the 'CustomerID' values are missing, and 1% of 'ProductID' values are missing. There are no missing values in other columns. The data scientist wants to clean the data and prepare it for customer segmentation. Which course of action is most appropriate?

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

Remove rows with negative 'Quantity' to focus on purchases. Impute missing 'CustomerID' and 'ProductID' with a placeholder such as 'Unknown'.

The most appropriate approach. Negative quantities represent returns, which should be removed when analyzing purchase behavior for customer segmentation. Imputing missing 'CustomerID' and 'ProductID' with a placeholder like 'Unknown' retains data without guessing categorical values. Option A is incorrect because mean imputation is not valid for categorical 'CustomerID'. Option B is incorrect because removing all rows with missing values would discard valuable data. Option C is incorrect because negative quantities are meaningful returns, not errors, and replacing them distorts the data.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Impute missing 'CustomerID' with the mean of 'CustomerID' and missing 'ProductID' with the mode.

    Why it's wrong here

    CustomerID is categorical; mean is invalid.

  • Remove all rows with any missing values.

    Why it's wrong here

    Removing 3% of data may lose valuable information.

  • Keep negative 'Quantity' and treat them as errors; replace them with the median of positive quantities.

    Why it's wrong here

    Negative quantities represent returns and should be handled separately.

  • Remove rows with negative 'Quantity' to focus on purchases. Impute missing 'CustomerID' and 'ProductID' with a placeholder such as 'Unknown'.

    Why this is correct

    Negative quantities are returns; imputing with 'Unknown' preserves rows.

About these practice questions

This MLS-C01 question is part of Courseiva's 1,672-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.