Missing data in pandas: NaN, None and NA
Answer: pandas uses different sentinel values to represent a missing (also referred to as NA) value depending on the data type. To detect these missing values, use the isna() or notna() methods, which will also consider None a missing value. (S1)
Sentinels and dtypes
- The disadvantage of using NumPy data types is that the original data type will be coerced to np.float64 or object. (S1)
- The nullable types maintain the original data type of the data. (S1)
- NA is a scalar (singleton) used to represent missing values for nullable dtypes. (S1)
- Currently, pandas does not use those data types using NA by default in a DataFrame or Series, so you need to specify the dtype explicitly. (S1)
- NA comparisons deviate from the behaviour of np.nan, where comparisons with np.nan always return False. (S1)
Where NaN appears
- In arithmetic, pandas automatically broadcasts along the specified dimension and will fill unaligned labels with np.nan. (S2)
Claims
- id: C1 claim: pandas uses different missing-value sentinels by dtype. source: S1 evidence: "pandas uses different sentinel values to represent a missing"
- id: C2 claim: Use isna() or notna() to detect missing values. source: S1 evidence: "To detect these missing value, use the isna() or notna() methods."
- id: C3 claim: NA is a singleton for nullable dtypes. source: S1 evidence: "NA is a scalar (singleton) used to represent missing values for"
- id: C4 claim: Unaligned labels are filled with np.nan. source: S2 evidence: "automatically broadcasts along the specified dimension and will fill unaligned labels with np.nan."
Sources
- [S1] Working with missing data — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/user_guide/missing_data.html . License: BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE). Accessed 2026-11-04.
- [S2] 10 minutes to pandas — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/user_guide/10min.html . License: BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE). Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: pandas docs, Working with missing data — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE); pandas docs, 10 minutes to pandas — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE).
Cite this
iinventedlight. 2026. "Missing data in pandas: NaN, None and NA." iinventedlight Library, iil:note:a5xt5929, version of 2026-11-04. https://iinventedlight.com/library/notes/pandas-missing-data/. License: CC-BY-4.0.
@misc{iil_note_a5xt5929,
author = {{iinventedlight}},
title = {{Missing data in pandas: NaN, None and NA}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/pandas-missing-data/},
note = {Permanent ID iil:note:a5xt5929. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/pandas-missing-data.md.