考虑以下代码,我只想更改1个单元格,但整个行都会更改:
df=DataFrames.DataFrame(A=[1,2],B=[3,4])
df[2,:A]=7 # this is OK, changes only 1 cell
df[:,1:end]=0.0 # this line somehow makes the change in the next line behave unexpectedly
df[2,:A]=7 # entire 2nd row is 7
Run Code Online (Sandbox Code Playgroud)
就像df[:,1:end]=0.0将该行的所有单元格设置为相同的引用一样; 但我将它设置为0.0,所以我希望这是一个值副本,而不是参考副本
版本:julia版本0.4.6-pre DataFrames v"0.7.8"