When I try to import a csv file into a Julia DataFrame as descibed in this blogpost I get unexpected results.
DataFrame() puts each CSV.Row into a cell instead of each field. CSV.jl doesn't seem to be the problem, since the CSV.Row objects are correct. Does somebody see what I'm missing here?
example.csv
col1,col2,col3
1,2,3
2,3,5
0,1,1
using CSV
using DataFrames
DataFrame(CSV.File("example.csv"))
result
| x1 | x2 | x3 |
|---|---|---|
| CSV.Row: (col1 = 1, col2 = 2, col3 = 3) | CSV.Row: (col1 = 2, col2 = 3, col3 = 5) | CSV.Row: (col1 = 0, col2 = 1, col3 = 1) |
expected result
| col1 | col2 | col3 |
|---|---|---|
| 1 | 2 | 3 |
| 2 | 3 | 5 |
| 0 | 1 | 1 |
Edit
I was using:
CSV v0.8.3
DataFrames v0.13.1