fsprojects / FSharp.Data

F# Data: Library for Data Access
https://fsprojects.github.io/FSharp.Data
Other
816 stars 287 forks source link

CsvProvider fails to parse float formatted as -7e-04 #1305

Open pkese opened 4 years ago

pkese commented 4 years ago

Apparently there's a problem with parsing .csv file when a float is formatted as -7e-04.

Following is the code snippet.

CsvProvider<"https://github.com/TheEconomist/big-mac-data/raw/master/output-data/big-mac-raw-index.csv">
    .GetSample()
    .Rows
|> Seq.iter (fun row -> printfn "%s @ %d -> %f" row.Iso_a3 row.Date.Year row.Dollar_price)

Source .csv is
https://github.com/TheEconomist/big-mac-data/raw/master/output-data/big-mac-raw-index.csv
and the offending row is

2017-01-01,CRI,CRC,Costa Rica,2250,554.33,4.05895405264012,-0.19784,-7e-04,0.08866,0.24615,0.43443

NOTICE:
I've tried to download the whole .csv to disk and curiously it works when data is read from local file.
It only fails when accessed through http.

deviousasti commented 4 years ago

Could this be a text-encoding issue?