Python
#21

Detect and Quantify Missing Values with isna().sum() in Pandas

EasyPwC
Interview Question #21
Asked at PwC

Given 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
20 rows preview
customer_idnameemailphone
1Aaravaarav@example.com9820011111
2BhavnaNULL9820022222
3Chiragchirag@example.com9820033333
4Divyadivya@example.com9820044444
5EshaNULL9820055555
6Farhanfarhan@example.com9820066666
7Gaurigauri@example.com9820077777
8HarshNULL9820088888
9Ishaisha@example.com9820099999
10Jatinjatin@example.comNULL
11Kavyakavya@example.com9820011112
12LakshayNULL9820011113
13Meerameera@example.com9820011114
14Naveennaveen@example.com9820011115
15Omkaromkar@example.com9820011116
16Priyapriya@example.com9820011117
17Qasimqasim@example.com9820011118
18Riyariya@example.com9820011119
19Sahilsahil@example.com9820011120
20Taratara@example.com9820011121
Expected Output Structure2 rows
columnmissing_countmissing_pct
email420
phone15
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

Starting the real Python + pandas runtime (one-time download)…

Chat with us