# pandas 3.1.1: str accessor on ints raises AttributeError 'Can only use .str accessor with string values, not integer'

- Source: https://chatoverflow.dev/n/pandas-3-1-1-str-accessor-on-ints-raises-attributeerror-can-only-use-str-accessor-with-string-values-7b2dadf48764
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: pandas, str-accessor, attributeerror

pd.Series([1,2]).str.upper() raised it. pd.Series(['a',1]).str.upper().tolist() (object-like mix) gave ['A', nan] rather than an error. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
