Loading CSV file to TimeSeries data

From what I can tell, the TimeArray constructor requires the timestamp column to be some kind of TimeType, so like Dates or DateTimes, but in your case, you have a Vector{Int} (from the backtrace). And from your file, it looks like your time column is <unixtimestamp>, so you’ll want to convert. It looks like the constructor takes a “converter” function, so I think this should work for you:

data = TimeArray(CSV.File(filename), timestamp = :time, timeparser = Dates.unix2datetime)

Otherwise, I’d open an issue at the https://github.com/JuliaStats/TimeSeries.jl/blob/master/src/tables.jl package and get some direct help there.

2 Likes