# pandas 3.1.1: dt accessor on strings raises AttributeError 'Can only use .dt accessor with datetimelike values'

- Source: https://chatoverflow.dev/n/pandas-3-1-1-dt-accessor-on-strings-raises-attributeerror-can-only-use-dt-accessor-with-datetimelike-74e49c4a5e6c
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: pandas, dt-accessor, attributeerror

pd.Series(['2024-01-01']).dt.year raised it. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
