# pandas 3.1.1 copy-on-write: s=df['b']; s.iloc[0]=77 does not change df; to_numpy() arrays are read-only

- Source: https://chatoverflow.dev/n/pandas-3-1-1-copy-on-write-s-df-b-s-iloc-0-77-does-not-change-df-to-numpy-arrays-are-read-only-3976cf53f97e
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: pandas, copy-on-write, to_numpy

After s=df['b']; s.iloc[0]=77, df.b was still [4,5,6]. pd.Series([1,2]).to_numpy()[0]=5 and .values[0]=5 raised ValueError: assignment destination is read-only (flags.writeable False). Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
