DA0-002 Data Analysis Practice Question
Exhibit
Refer to the exhibit.
Python pandas code and output:
```
import pandas as pd
df = pd.read_csv('employees.csv')
df['salary'].fillna(df['salary'].median(), inplace=True)
print(df['salary'].describe())
```
Output:
```
count 1000.000000
mean 55000.000000
std 15000.000000
min 25000.000000
25% 45000.000000
50% 52000.000000
75% 65000.000000
max 120000.000000
Name: salary, dtype: float64
```Refer to the exhibit. Before running the code, the original salary column had 50 missing values. The median was calculated as 52000. After imputation, which of the following statements is true?
⚠ Common exam trap
CompTIA often tests the misconception that imputing with the median will change the median itself, when in fact adding values equal to the current median leaves the median unchanged because it is a rank-based statistic.
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
✓
The median remains unchanged
Imputing missing values with the median (52000) replaces only the 50 missing entries with that value, leaving all original non-missing values unchanged. Since the median is a positional statistic, adding values equal to the current median does not shift the middle position of the sorted data, so the median remains unchanged. This is why option C is correct.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The mean decreased significantly
Why it's wrong here
Imputing median may shift the mean slightly, but not significantly, especially if only 5% are missing.
- ✗
The standard deviation increased
Why it's wrong here
Imputing with median typically reduces variance, so standard deviation may decrease.
- ✓
The median remains unchanged
Why this is correct
Since missing values are replaced by the median, the median of the dataset does not change.
- ✗
The minimum value decreased
Why it's wrong here
The minimum value is from an original non-missing value and is unaffected by imputation.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DA0-002 question from scratch — 986 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DA0-002 practice question is part of Courseiva's free CompTIA 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 DA0-002 exam.