You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With copy=False and constructing a DataFrame with missing columns in the passed data, the columns get constructed as identical arrays, so mutating one also incorrectly mutates the other columns:
In [10]: df = pd.DataFrame(index=[1, 2, 3], columns=["a", "b", "c"], copy=False)
In [11]: df.iloc[0, 0] = 0
In [12]: df
Out[12]:
a b c
1 0 0 0
2 NaN NaN NaN
3 NaN NaN NaN