I have always made new columns in pandas using the following:
df[\'new_column\'] = value
I am using this method, however, am receiving the warn
Try using
df.loc[:,'new column'] = value
As piRSquared comments, dfis probably a copy of another DataFrame and when you set values to df it probably incurs in what is called chain indexing. Refer to pandas docs for further information.
df