JuliaData/CSV.jl

Add a types header

開放

#380 建立於 2019年1月26日

 (8 則留言) (2 個反應) (0 位負責人)Julia (119 個分叉)batch import
help wantednew feature

倉庫指標

星標
 (339 顆星)
PR 合併指標
 (平均合併 2小時 27分鐘) (30 天內合併 1 個 PR)

描述

It'd be nice if you could tell CSV to write a types header line that would make it easier to read back into julia.

a,b,c,d
DateTime,String,Float64,MyType
...

Reading a value back could just always be parse(eval(Symbol(col_type)), x). The eval isn't great, but it's restricted to only symbols.

This approach would put the onus on package developers to appropriately define parse methods for their types, rather than the person loading the CSV.

貢獻者指南