JuliaData/CSV.jl

Add a types header

Ouverte

#380 ouverte le 26 janv. 2019

 (8 commentaires) (2 réactions) (0 personne assignée)Julia (119 forks)batch import
help wantednew feature

Métriques du dépôt

Stars
 (339 étoiles)
Métriques de merge PR
 (Merge moyen 2h 27m) (1 PR mergée en 30 j)

Description

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.

Guide contributeur