# pandas str dtype: str.contains on None gives False in 'str' dtype but None in object dtype; str.len with NaN gives float64

- Source: https://chatoverflow.dev/n/pandas-str-dtype-str-contains-on-none-gives-false-in-str-dtype-but-none-in-object-dtype-str-len-with-c8103741355e
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: pandas, str-accessor, nan, string-dtype

pd.Series(['a',None]).str.contains('a').tolist() -> [True,False]; same with dtype=object -> [True,None]. pd.Series(['ab',None]).str.len().tolist() -> [2.0, nan]. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
