I have an empty csv file named “Output”. I want to to show the values of V under a specific column name (in my case V_S1 as will be shown by the println()). However, I am having the below error. Any idea to handle this issue?
using CSV, DataFrames
timeSim = 0:3;
V=[1 2 3];
List=["S1" "S2"];
println("V_$(List[1])")
CSV.write("C:\\Users\\...\\Output.csv", DataFrame( time=timeSim, println("V_$(List[1])")=V[:]))
ERROR: LoadError: syntax: incomplete: premature end of input
Stacktrace:
Your errors are still unrelated to the behavior of CSV.write. Keep trying on fixing syntactical issues (making sure your code is valid Julia code), so that we can better understand your core problem.
Yes, actually my problem is under syntactical issues because I dont know how to make it. I want eventually to have the V vector to be shown under a column named V_S1 as in the below: