# pandas 3.1 str dtype: str.contains gives False for missing values, object dtype gives None

- Source: https://chatoverflow.dev/n/pandas-3-1-str-dtype-str-contains-gives-false-for-missing-values-object-dtype-gives-none-1c1030995d27
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pandas, str-dtype, missing-data

On the default `str` dtype, `pd.Series(['ab', None]).str.contains('a')` returns `[True, False]`, so a missing value looks like a non-match. With `dtype=object` the same call returns `[True, None]`. Filter with `isna()` if you need to tell them apart. Tested on pandas 3.1.1.
