Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Data preprocessing
  • Data Manipulation
  • Data Analysis using Pandas
  • EDA
  • Pandas Exercise
  • Pandas AI
  • Numpy
  • Matplotlib
  • Plotly
  • Data Analysis
  • Machine Learning
  • Data science
Open In App
Next Article:
Difference between isna() & isnull() in Pandas
Next article icon

Difference between isna() & isnull() in Pandas

Last Updated : 30 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

When you work with real-world data, it’s common to find missing or empty values. It’s important to handle these missing values carefully, especially when cleaning or exploring your data. Pandas, a popular Python tool for working with data, has two functions called isna() and isnull() that help you find these missing values. Even though their names are different, they actually do the same thing. This article will explain what these functions do, how they work, the small differences between them, and the best times to use each one.

What is isna() in Pandas?

The isna() function in Pandas is used to detect missing values in a DataFrame or Series. It returns a boolean object of the same shape, where True indicates the presence of a null (NaN) value and False indicates a non-null value.

Syntax

DataFrame.isna()
Series.isna()

Parameters: No parameters needed.

Returns: A boolean DataFrame or Series indicating where values are NaN.

Example:

Python
import pandas as pd  df = pd.DataFrame({     'Name': ['Alice', 'Bob', None],     'Age': [25, None, 30] })  print(df.isna()) 

Output:

Name Age

0 False False

1 False True

2 True False

What is isnull() in Pandas?

The isnull() function works exactly like isna() it checks for NaN values in a DataFrame or Series and returns a boolean mask. It’s essentially an alias for isna().

Syntax

DataFrame.isnull()

Series.isnull()

Parameters: No parameters needed.

Returns: A boolean DataFrame or Series indicating where values are NaN.

Example:

Python
print(df.isnull()) 

Output:

Name Age

0 False False

1 False True

2 True False

Key Difference Between isna() and isnull()

Feature

isna()

isnull()

Function Type

Primary function

Alias for isna()

Source

Introduced to align with NumPy naming conventions

Original Pandas function

Use case

Preferred for consistency with NumPy

Commonly used for readability

Behavior

Identical

Identical

In essence, there is no difference in behavior. They are interchangeable and produce the same result.

When to Use isna() vs. isnull()?

  • Use isna() if you want consistency with NumPy (np.isnan) or follow newer Pandas conventions.
  • Use isnull() if you find it more intuitive or readable in your project.

It often comes down to personal or team preference both work identically.

How to Handle Missing Data Using isna() or isnull()

Once missing values are detected, you may want to handle them using methods such as:

1. Dropping rows with missing values

Python
df_cleaned = df.dropna() 

2. Filling missing values

Python
df_filled = df.fillna(value={'Age': 0}) 

3. Counting missing values

Python
missing_counts = df.isna().sum() print(missing_counts) 

Next Article
Difference between isna() & isnull() in Pandas

B

bhumimlna4
Improve
Article Tags :
  • Pandas
  • Python-pandas
  • python
Practice Tags :
  • python

Similar Reads

    Difference between size and count in Pandas?
    When dealing with data frames, two commonly used methods are size() and count(). While they might seem similar at first glance, they serve different purposes and produce different results. In this article, we'll explore the What's the differences between size() and count() in Pandas and when to use
    4 min read
    Check for NaN in Pandas DataFrame
    NaN stands for Not A Number and is one of the common ways to represent the missing value in the data. It is a special floating-point value and cannot be converted to any other type than float.  NaN value is one of the major problems in Data Analysis. It is very essential to deal with NaN in order to
    3 min read
    Boolean Indexing in Pandas
    In boolean indexing, we will select subsets of data based on the actual values of the data in the DataFrame and not on their row/column labels or integer locations. In boolean indexing, we use a boolean vector to filter the data.  Boolean indexing is a type of indexing that uses actual values of the
    6 min read
    pandas.isna() function in Python
    This method is used to detect missing values for an array-like object. This function takes a scalar or array-like object and indicates whether values are missing (``NaN`` in numeric arrays, ``None`` or ``NaN`` in object arrays, ``NaT`` in datetimelike). Syntax : pandas.isna(obj) Argument : obj : sca
    1 min read
    How To Check If Cell Is Empty In Pandas Dataframe
    An empty cell or missing value in the Pandas data frame is a cell that consists of no value, even a NaN or None. It is typically used to denote undefined or missing values in numerical arrays or DataFrames. Empty cells in a DataFrame can take several forms:NaN: Represents missing or undefined data.N
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences