So I am doing this super simple program and it's returning a set with copy warning. I'm using iloc.
My goal is to check if the values in check if the value is a null and replace it with a tuple with 3 None values. It does work, but I'd like to avoid the copy warning.
df = pd.DataFrame({'a':[None,1, 2], 'b':[None, (1,2,3), (3,4, 5)]})
a b
0 NaN None
1 1.0 (1, 2, 3)
2 2.0 (3, 4, 5)
if pd.isna(df['b'].iloc[0]):
df['b'].iloc[0] = (None, None, None)