Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

Pandas DataFrame notnull() Method

❮ DataFrame Reference


Example

Replace all values in the DataFrame with True for NOT NULL values, otherwise False:

In this example we use a .csv file called data.csv

import pandas as pd

df = pd.read_csv('data.csv')

newdf = df.notnull()
Try it Yourself »

Definition and Usage

The notnull() method returns a DataFrame object where all the values are replaced with a Boolean value True for NOT NULL values, and otherwise False.


Syntax

dataframe.notnull()

Parameters

This method takes no parameters.


Return Value

A DataFrame with Boolean values.


❮ DataFrame Reference