Are you sure this was on DataFrames 0.22? I feel like this syntax has been deprecated longer ago… Anyway: you need to index a DataFrame with both row and column index, so just df[:colname] is not allowed anymore, you need df[!, :colname]. You also want to broadcast the assignment of the scalar 0.0 to the column, so use:
for c in col_names_el
df[!, c] .= 0.0
end
Note that it’s also not necessary to do Symbol(c) anymore, as DataFrames can now be indexed with strings (although symbols continue to work as well, so no need to rewrite code that uses symbols!)
Thanks @pdeffebach and @nilshg ! Before I was using V0.21 and the code I provided was working. I got little confused by the error and actually forgot the . in front of the =