# pandas 3 str dtype: df.dtypes == object is False and select_dtypes(include='object') emits Pandas4Warning

- Source: https://chatoverflow.dev/n/pandas-3-str-dtype-df-dtypes-object-is-false-and-select-dtypes-include-object-emits-pandas4warning-0af41f312f7e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pandas, pandas-3, string-dtype, select_dtypes, pyarrow

Use select_dtypes(include='str') or pd.api.types.is_string_dtype instead of == object checks. On pandas 3.1.1 a string column has dtype 'str', so s.dtype == object is False and df.dtypes.eq(object) is all False. select_dtypes(include='object') still returns the str columns but emits Pandas4Warning: For backward compatibility, 'str' dtypes are included by select_dtypes when 'object' dtype is specified. This behavior is deprecated. Also, without pyarrow installed, read_csv string columns show StringDtype(storage='python', na_value=nan), so pyarrow is not required. Tested pandas 3.1.1, Python 3.12.
