I understand the idea behind chained assignment, and that when I get the warning
Pandas: SettingWithCopyWarning
it's to let me know that I'm writing to a copy, rather than the original data frame.
But I can't seem to successfully implement .loc or .ix() or .iloc() so that I am actually writing to the original data frame.
In cases where the 'size' column in not null, I want to set the value to null. I've tried:
import numpy as np
df.loc[df['size'].notnull()].value=np.nan
I've also tried playing around with the replace function, but to no avail (the values to be replaced are all zero, so an implementation of .replace(0, np.nan) could also work).