I am just beginning to learn pandas and am looking to provide some automated help. From what I read, it appears that SettingWithCopyWarning is something that confuse many people. Is the following correct?
In [2]:
df=pd.DataFrame([[10,20,30],[40,50.,60]],
index=list("ab"),
columns=list("xyz"))
In [3]:
df.loc["b"]["x"]=99
In [4]:
# What is SettingWithCopyWarning ?
what()
In [5]:
# Can I get more specific information for what I just did?
why()
In [6]:
# What about if I tried to use indirect chaining.
# There are two possibilities
series=df.loc["b"]
series["x"]=99
In [7]:
where()
In [8]:
why()
In [9]:
# What if I do things in a different order
series_1=df["x"]
series_1.loc["b"]=99
In [10]:
where()
In [11]:
why()
In [12]:
# What if I had multiples data frames?
df2=df.copy()
series=df.loc["b"]
series["x"]=99
In [13]:
where()
In [14]:
why()