I need to add columns to the DataFrame df. The values for all new columns should be fixed along all rows of df:
df = {
"NUM":[1,2],
"WAKE":["M","H"],
"DISTANCE":[780,500]
}
new_df = pd.DataFrame(df)
This is how I tried to add new multiple columns with fixed values.
for column, row in new_df.iterrows():
row["TEMPERATURE"] = 20
row["VISIBILITY"] = 5000
row["WIND"] = 10
This code does not fail, but new columns are not created.
The expected result:
NUM WAKE DISTANCE TEMPERATURE VISIBILITY WIND
1 M 780 20 5000 10
2 H 500 20 5000 10