Detecting any missing values with .isna().any() is the fastest 1-line sanity check you’ll ever write. It answers the critical question: “Does this column (or the whole DataFrame) contain even a single NaN/None/null?” — without printing huge boolean masks or computing full counts.
In pandas, df.isna().any() returns a boolean Series: True for every column that has at least one missing value, False otherwise. Chain another .any() to check the entire dataset in one boolean. In 2026, this is still your go-to first line after pd.read_csv() or pl.read_csv().
1. Basic & Practical Usage (Pandas)
import pandas as pd
# Realistic messy dataset example
data = {
'name': ['Alice', 'Bob', 'Charlie', 'David', 'Eve'],
'age': [25, None, 34, 28, 31],
'salary': [55000, 72000, None, 61000, None],
'city': ['New York', 'Chicago', 'Los Angeles', 'Boston', 'Seattle'],
'department': ['HR', 'IT', 'Finance', None, 'Marketing']
}
df = pd.DataFrame(data)
# Fastest check: any missing per column?
print("Any missing values per column?")
print(df.isna().any())
# One-liner: list columns that have at least one missing value
missing_cols = df.columns[df.isna().any()].tolist()
print("\nColumns with missing values:", missing_cols)
# Single boolean: does the entire DataFrame have any missing values at all?
print("\nDataset has ANY missing values anywhere?", df.isna().any().any())
**Typical output:**