Closed 1337SEnergy closed 4 years ago
I had a quick look. readtimearray calls (line 5) readdlm from the library DelimitedFiles. Basically it loads the file. If your CSV file uses unix timestamp as row index, the function readdlm parses its as Float, and not a string as with dates in usual format ( YYYY-MM-DD or something equivalent).
Then when it comes to removing empty lines in readtimearray (line 11), index, as Float, have a length 1 so the code remove everything and return a 0-element Array{Float64,1} as index.
My first time here, and not a professional developper (more on the maths side), but I think a proper way to deal with this could be to add to the file readwrite.jl a function which parses date, an call it in readtimearray, so we could deal with dates and unix timestamp.
well, inferded type of column date
is Int
.
TimeArray
only accepts time type as timestamp.
julia> using Tables
julia> Tables.schema(CSV.File("./tmp/data.csv"))
Tables.Schema:
:date Int64
:high Float64
:low Float64
:open Float64
:close Float64
:volume Float64
:quoteVolume Float64
:weightedAverage Float64
Maybe it's time for creating a new type to accept Int/Float as timestamp.
Hi @RealSEnergy , I enhance the constructor of TimeArray(table, ...)
.
Could you check the PR #447 out?
Julia 1.3.1
loading using CSV:
the file contains data as follows:
I've been stuck on this for past 2 hours and it's driving me mad, nothing works to read these data... I can read them with CSV package, but then I can't convert it to TimeArray for plotting