WorksheetsDay 6: Missing Values - Theory and Impact
Total questions: 10
Worksheet time: 5mins
Which example best illustrates a sentinel value that can distort averages when treated as numeric?
Blank entries in a survey column
Random NaN sprinkled across rows
String 'not reported' labels
Numeric code -999 for missing
A dataset uses 'N/A' for income and 0 for pregnancy weeks. What is the most appropriate first step before choosing an imputation strategy?
Drop all rows with any missing
Replace all missing with column means
Determine the meaning of each missing pattern
Train a tree model directly
You find domain strings like 'N/A', 'unknown', and '?' in a column. What is the most appropriate first step to ensure these are counted in missingness summaries?
Fill these strings with the column median value
Drop rows containing these strings immediately
Convert the column to integers to coerce errors
Replace these strings with np.nan using token normalization
Map these strings to a new category called 'missing_text'
A function computes total = df.isna().sum() and pct = (df.isna().mean() * 100).round(1). What does this summary primarily help you decide?
Which features require scaling or normalization
Which columns have outliers beyond three sigma
Which rows violate uniqueness constraints
Which columns to drop or need imputation
Which joins require foreign key repair
In pandas, what does df.dropna() do by default when no axis is specified?
Drops rows containing any missing values
Flags missing values with indicator columns
Drops columns with any missing values
Replaces missing values with column means
Which basic imputation choice is most robust for skewed numeric distributions such as income?
Mode imputation for continuous variables
Random sampling from observed values
Median imputation for skewed distributions
Mean imputation for all numeric features
A dataset’s income feature is right-skewed with rare very high earners. Which imputation choice best represents a typical user’s missing income?
Mean value of the income
Mode of the income
A constant highest observed income
Median value of the income
You need to deduplicate rows by user_id and event_time only, keeping the first occurrence. Which Pandas approach aligns with subset-based detection?
df.drop_duplicates(subset=["user_id","event_time"], keep="first")
df.unique(["user_id","event_time"], keep="first")
df.duplicated(keep=False).any(axis=1)
df.dropna(subset=["user_id","event_time"], inplace=True)
In a dataset with a highly skewed age distribution, which imputation method is least likely to misrepresent the typical age of users?
Random sampling from the dataset
Mode imputation
Mean imputation
Median imputation
When analyzing a dataset, which method is most effective for identifying and handling outliers before applying imputation?
Applying mean imputation directly
Dropping all rows with any missing values
Using z-scores to flag outliers
Using a random forest model to predict missing values
