MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Detecting Missing Values (isna, notna, isnull)0%
Study MaterialsCheatsheet
PandasProgress 0%
1.1What is Pandas & Core Architecture1.2Pandas Installation & Environment Setup1.3Creating Series & DataFrames from Scratch
4.1Detecting Missing Values (isna, notna, isnull)4.2Dropping & Filling Missing Values (dropna, fillna)4.3Handling Duplicates & Data Type Conversions
HomeTutorialsPandasDetecting Missing Values (isna, notna, isnull)
Dropping & Filling Missing Values (dropna, fillna)

Detecting Missing Values (isna, notna, isnull)

Intermediate6 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

1. What is Missing Data in Pandas?

Real-world datasets are almost never 100% complete. In Pandas, missing data is represented as:

  • np.nan (Not a Number, a special IEEE floating-point value)
  • pd.NA (Pandas' modern experimental nullable missing indicator)
  • None (Standard Python null object, automatically cast to NaN in numeric columns)
Real-world Analogy: Jaise exam me kisi student ki attendance sheet par blank space reh jati hai ya registration form me phone number fill nahi kiya gaya hota, wahi Pandas me NaN kehlata hai.

2. Detecting Missing Data: .isna() vs .isnull()

In Pandas, .isna() and .isnull() are 100% identical aliases. .isna() is preferred because it matches the modern scientific terminology (is NA).

1import pandas as pd
2import numpy as np
3 
4df = pd.DataFrame({
5 'Name': ['Amit', 'Sunita', np.nan, 'Rohan', 'Sneha'],
6 'Age': [24, np.nan, 29, 31, np.nan],
7 'Salary': [50000, 62000, 58000, np.nan, 67000]
8})
9 
10print(df.isna())

Output (Boolean Matrix):

1 Name Age Salary
20 False False False
31 False True False
42 True False False
53 False False True
64 False True False

3. Summarizing Missing Data Across Columns

To compute the exact number and percentage of nulls in each column:

1# 1. Count of missing values per column
2missing_counts = df.isna().sum()
3print("Missing counts:\n", missing_counts)
4 
5# 2. Percentage of missing values
6missing_pct = (df.isna().sum() / len(df)) * 100
7print("\nMissing Percentage:\n", missing_pct)

Output:

1Missing counts:
2Name 1
3Age 2
4Salary 1
5dtype: int64

4. Filtering Rows with or without Missing Data

  • df[df['Salary'].isna()]: Find all rows where Salary is missing.
  • df[df['Name'].notna()]: Keep only rows where Name is present.

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
What is the standard representation of missing floating-point values in Pandas?
Question 2
What is the difference between df.isna() and df.isnull()?
Question 3
Which code snippet returns the total count of missing values in each column?
Question 4
Which method is the logical opposite of df.isna(), returning True for valid non-null entries?
Question 5
Why can direct equality comparison like np.nan == np.nan not be used to check for missing values?

Next Lesson

Dropping & Filling Missing Values (dropna, fillna)

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
Setting, Resetting & Managing IndicesDropping & Filling Missing Values (dropna, fillna)

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

12-Month Data Analysis Mastery Program

Master Full-Stack Data Analytics (Excel, SQL, Python, Power BI & Tableau)

Combine 15 complete courses, 150 chapters, 541 topics, live SQL/Power BI/Tableau dashboards, and Scikit-Learn capstones at MSK Institute Shikohabad or Live Online.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext