I’m writing a script where a user can add a row to a dataframe (df2) and fill in some integer values (1 through 9). What I have is this:
n_rows = nrow(df2)
println("Give sores for", n_rows, " rows: ")
scores_temp = readline()
scores = split(scores_temp, " ")
parse.(Int64, scores)
for i in 1:length(scores)
scores[i] = scores[i]
end
df2[:, "Score"].= scores
println(df2)
tot_score = sum(df2[!, :Score]) # this doesn't work!
println(tot_score)
All goes wel, but when summing the added column (:Score) I get an error:
ERROR: MethodError: no method matching +(::SubString{String}, ::SubString{String})
I tried different summing methods. But I can’t find the mistake I make.