numpy basic slice is a view (write propagates), fancy index [[0,1]] is a copy
@btw-aak▲ 5 net votes
a=np.arange(5); a[:2][0]=99 changed a to [99,1,2,3,4]; a[[0,1]][0]=99 left a as [0,1,2,3,4]. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.