NCA-ADS - Data Manipulation and Preparation (23% of the exam) - Section 1.2
Handle data cleaning and data quality.
Identify and resolve common data quality issues including missing values, duplicates, outliers, and inconsistent types. Choose appropriate imputation or removal strategies based on the distribution and downstream model requirements.
Practice question for this objective
lock_openFree sampleData Manipulation and Preparationeasy
A data quality reviewer loads a cuDF DataFrame of customer records and wants a single number per column showing how many entries are missing, so she can decide which columns need imputation. She plans to chain a null-detection step with a per-column total. Which combination of cuDF operations gives the count of missing values in each column?
AApply the duplicated operation to mark repeated rows, then total those marks per column to count the missing entries.
BApply the isnull operation to produce a boolean mask, then total the True values down each column with a column-wise sum.check_circle Correct
CApply the unique operation to each column, then total the distinct values to count the missing entries.
DApply the describe operation, then read the standard deviation row as the count of missing entries per column.
Combine the cuDF isnull mask with a column-wise sum to count missing values per column. Isnull produces a boolean mask in which True marks each absent entry, and because True counts as 1 under summation, a column-wise sum over that mask returns the exact number of missing values in every column.
Why A is wrong: The duplicated operation flags repeated rows, not absent values, so totalling its marks reports duplication rather than missingness and answers a different question.
Why B is correct: Isnull returns a boolean DataFrame where True marks each missing entry, and summing those booleans down each column counts the missing values per column, which is the requested per-column missingness tally.
Why C is wrong: Unique lists the distinct values in a column, so totalling them measures cardinality; nulls are not counted as a value to sum, and this does not yield a missing-value total.
Why D is wrong: Describe reports summary statistics such as count, mean and standard deviation; standard deviation measures spread, not missingness, so reading it as a null count is incorrect.
Answers that look right on this material and are not. Each one is a distractor from a different question in the NCA-ADS bank for this domain.
All three columns are read back as object-typed strings, because Parquet stores every value as text and the reading stage must re-infer and re-cast each column to recover its numeric or categorical type.
errorWhy it is wrong: This describes CSV behaviour, where everything is serialised as text and types must be inferred on read; Parquet stores typed binary data, so columns do not degrade to strings on a round-trip.
Drop every row that contains a null in that column
errorWhy it is wrong: Dropping rows is fast and simple, but discarding 8% of records reduces the training set and can introduce bias if the missing pattern correlates with the target, making it a poor default when imputation is feasible.
Leave the -999 entries in place, because numeric summaries such as the mean automatically exclude any unusually low value.
errorWhy it is wrong: Numeric summaries treat -999 as a real observation, so the mean would be dragged sharply downward; nothing about the value being low causes it to be excluded, which is why the sentinel must be handled first.