I thought I understood that an assignment of a second df works with a reference / pointer. So in the code below the first element changes in 'both' df's. But what happens with .dropna() was unexpected for me. It seems somehow this method creates a copy. Anyone know how this works and why? See the second code part. I expected the two df's to have changed.
df1 = pd.DataFrame([1, np.NaN, 2, 3, 5, np.NaN])
df2 = df1
df3 = df1
df2.iloc[0, 0] = 9
#Both changed
display(df1)
display(df2)
df3 = df3.dropna()
#Only df3 changed ??
display(df1)
display(df3)