df1 = pd.DataFrame({'A':['aaa','bbb','ccc'], 'B':[1,2,3]})
df2=df1.copy()
df1.loc[0,'A']='111' #modifying the 1st element of column A
print df1
print df2
When modifying df1 the object sf2 is not modified. I expected it because I used copy()
s1=pd.Series([[1,2],[3,4]])
s2=s1.copy()
s1[0][0]=0 #modifying the 1st element of list [1,2]
print s1
print s2
But why did s2 changed as well in this case? I expected no change of s2 because I used copy() to create it, but for my surprise, when modifying s1 the object s2 is also modified. I don't get why.