Say I have data in the following format
v = [(1, 0.1, [1, 2, 3]), (2, 0.2, [3,4,5])]
I can write it to a delimited file using
using DelimitedFiles
open("test.csv", w) do io
writedlm(io, v)
end
The content of test.csv is
1 0.1 [1, 2, 3]
2 0.2 [3, 4, 5]
I tried the following way to read it back:
w = open("test.csv", "r") do io
readdlm(io)
end
However, it splits the vector into parts of strings.
With CSV.jl, it also errored:
using CSV
CSV.File("test.csv", types=[Int, Float64, Vector{Int}]
Anyone has a better idea other than breaking the vector manually before saving?