Koskamo

Working with missing data

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

Use numpy.nan for NumPy types (coerced to float64 or object), NaT for datetime64, timedelta64, and PeriodDtype, and NA for StringDtype, Int64Dtype, Float64Dtype, BooleanDtype, and ArrowDtype, preserving the original type. isna() and notna() detect missing values, treating None as missing. Equality comparisons between np.nan, NaT, and NA do not act like None. Cumulative methods like cumsum() ignore NA values by default but preserve them; use skipna=False to include NA values. dropna() drops rows or columns with missing data. fillna() replaces NA values with non-NA data; when the dtype is not object, fill values are replaced with the proper NA value for the dtype. ffill() and bfill() fill gaps forward or backward, optionally limited via limit. Products treat NA values or empty data as 1. Scope: pandas. Reviewed October 4, 2026.

Source and provenance

Original source
pandas.pydata.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.