I have the following indexed DataFrame with named columns and rows not- continuous numbers:
a b c d 2 0.671399 0.101208 -
If you get the SettingWithCopyWarning, an easy fix is to copy the DataFrame you are trying to add a column to.
SettingWithCopyWarning
df = df.copy() df['col_name'] = values