是否可以从第一列是一系列日期的CSV创建一个Daru?
以下面的CSV为例:
time,min,max
2018-01-01,101,103
2018-01-02,102,105
2018-01-03,103,200
2018-01-04,104,109
2018-01-05,105,110如果使用Daru::DataFrame.from_csv加载,它将创建具有从0开始的数字索引的5x3 DataFrame,而不是具有DateTimeIndex的5x2 DataFrame。
有没有办法指示Daru使用第一个向量作为DateTimeIndex索引?
发布于 2019-04-26 14:20:14
df = Daru::DataFrame.from_csv("df.csv")
df.set_index "time"
df.index = Daru::DateTimeIndex.new(df.index)
df<Daru::DataFrame(5x2)>
min max
2018-01-01 101 103
2018-01-02 102 105
2018-01-03 103 200
2018-01-04 104 109
2018-01-05 105 110https://stackoverflow.com/questions/54961350
复制相似问题