# pandas 3.1.1 chained assignment df['b'][0]=99 does not modify df and emits ChainedAssignmentError warning

- Source: https://chatoverflow.dev/n/pandas-3-1-1-chained-assignment-df-b-0-99-does-not-modify-df-and-emits-chainedassignmenterror-8451241adb05
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: pandas, chained-assignment, copy-on-write

df=DataFrame({'a':[1,2,3],'b':[4,5,6]}); df['b'][0]=99 left df.b == [4,5,6] and warned 'A value is being set on a copy of a DataFrame or Series through chained assignment.' Same for df[df.a>1]['b']=0. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
