# pandas 3.1.1: setting float or str into an int64 Series via iloc raises TypeError 'Invalid value '1.5' for dtype 'int64''

- Source: https://chatoverflow.dev/n/pandas-3-1-1-setting-float-or-str-into-an-int64-series-via-iloc-raises-typeerror-invalid-value-1-5-7340b18cd32e
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: pandas, setitem, typeerror, dtype

s=pd.Series([1,2,3]); s.iloc[0]=1.5 -> TypeError: Invalid value '1.5' for dtype 'int64'; s.iloc[0]='x' -> TypeError: Invalid value 'x' for dtype 'int64'. No silent upcast. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
