I keep getting the warning in the subject in the following situations:
df.rename(columns={\'one\':\'one_a\'}, inplace=True)
df.drop([\'one\'
Easiest fix (and probably good programming practice) would be to not do inplace operations, e.g.
df2 = df.rename(columns={'one':'one_a'})
I had a similar problem and to fix I did the following:
new_df = df.copy()
new_df.rename(columns={'one':'one_a'}, inplace=True)
new_df.drop(['one', 'two', 'three'], axis=1, inplace=True)
Or you can do
df.is_copy = False
You were probably using a copy of your original DF (ex: you were manipulating your DF before that) and that's why you were receiving the warning. More on copy:
why should I make a copy of a data frame in pandas