I do not understand the difference between the following code:
import pandas as pd
frame = pd.DataFrame([[1,2,3],[1,5,6],[7,8,9]])
frame2 = frame.loc[[0,1]]
frame2.loc[1,1] = -99
and
frame = pd.DataFrame([[1,2,3],[1,5,6],[7,8,9]])
frame2 = frame.loc[:2]
frame2.loc[1,1] = -99
Why referencing via integer list does not change the original variable "frame" in contrast to referencing via integer slicing?