Python
All Top 50 Python & Pandas Interview Questions#21
Detect and Quantify Missing Values with isna().sum() in Pandas
EasyPwCInterview Question #21
Asked at PwCGiven a dataset, write a function that returns a summary DataFrame listing each column, its total count of missing values, and the percentage of missing values rounded to 2 decimal places.
Input Table: df_raw
2 rows preview| col_name | sample_missing |
|---|---|
| 20 out of 100 missing | |
| phone | 5 out of 100 missing |
Expected Output Structure2 rows
| column | missing_count | missing_pct |
|---|---|---|
| 20 | 20 | |
| phone | 5 | 5 |
Interview Context
Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.
Python 3.10 (Pandas)
Environment Ready
Click "Run & Test" to execute your Pandas code against the test assertions.