我想用 readtimearray 读取以下形式的 csv 文件:
"","ES1 Index","VG1 Index","TY1 Comdty","RX1 Comdty","GC1 Comdty"
"1999-01-04",1391.12,3034.53,66.515625,86.2,441.39
"1999-01-05",1404.86,3072.41,66.3125,86.17,440.63
"1999-01-06",1435.12,3156.59,66.4375,86.32,441.7
"1999-01-07",1432.32,3106.08,66.25,86.22,447.67
"1999-01-08",1443.81,3093.46,65.859375,86.36,447.06
"1999-01-11",1427.84,3005.07,65.71875,85.74,449.5
"1999-01-12",1402.33,2968.04,65.953125,86.31,442.92
"1999-01-13",1388.88,2871.23,66.21875,86.52,439.4
"1999-01-14",1366.46,2836.72,66.546875,86.73,440.01
但是,这是我在评估 readtimearray("myfile.csv") 时得到的
ERROR: `convert` has no method matching convert(::Type{UTF8String}, ::Float64)
in push! at array.jl:460
in readtimearray at /home/juser/.julia/v0.3/TimeSeries/src/readwrite.jl:25
我没有看到的是什么?
最佳答案
这看起来像是 readtimearray
中的一个错误。
空行被删除,但为了识别它们,
代码只查看第一列。
由于标题在第一列中有一个空字符串,因此将其删除...
将文件的标题更改为
"date","ES1 Index","VG1 Index","TY1 Comdty","RX1 Comdty","GC1 Comdty"
解决问题。
关于csv - Julia TimeSeries 包中的 Readtimearray 函数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31786795/