Multiplying columns in DataFrames

Your last attempt is quite confusing. Did you mean to have a transform call in there? Ideally it would be obvious why that didn’t work, but if you explain your logic for how you arrived at that solution we could better point you in the right direction.

That said, this one is very tricky! Here is a solution

julia> nms = names(df_1, Between(:VALUE, :GAIN))
3-element Array{String,1}:
 "VALUE"
 "INCOME"
 "GAIN"

julia> transform(df_1, vcat.("SCORE", nms) .=> ByRow(*) .=> nms)
6×5 DataFrame
 Row │ NAME    SCORE  VALUE  INCOME  GAIN  
     │ String  Int64  Int64  Int64   Int64 
─────┼─────────────────────────────────────
   1 │ Aa          0      0       0      0
   2 │ Bb          1    200      56     65
   3 │ AB         10   4000     900   1110
   4 │ CD         20  12000   20000   1300
   5 │ EF         30    300    1500   1020
   6 │ GH         45    900    2700   4500
1 Like