Skip to content

Instantly share code, notes, and snippets.

@dlintw
Created September 4, 2018 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlintw/8b0c971c96a8eb7f95d1c14edf272b3b to your computer and use it in GitHub Desktop.
Save dlintw/8b0c971c96a8eb7f95d1c14edf272b3b to your computer and use it in GitHub Desktop.
julia> df = CSV.read("test.csv", DataFrame)
ERROR: CSV.Error on row=4963, column=8:
Parsers.Error (INVALID: SENTINEL, DELIMITED, INVALID_DELIMITER):
initial value parsing failed, a sentinel value was parsed, a valid delimiter was parsed, invalid delimiter
attempted to parse Missing from: "ESVUFR,"
Stacktrace:
[1] stream!(::CSV.Source{Parsers.Delimited{false,Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}},Parsers.Trie{0x00,false,missing,8,Tuple{Parsers.Trie{0x2c,true,missing,8,Tuple{}},Parsers.Trie{0x0a,true,missing,8,Tuple{}},Parsers.Trie{0x0d,true,missing,8,Tuple{Parsers.Trie{0x0a,true,missing,8,Tuple{}}}}}}},Base.GenericIOBuffer{Array{UInt8,1}},Dates.DateFormat{Symbol("yyyy-mm-dd\\THH:MM:SS.s"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}},Int64}, ::DataStreams.Data.Query{0x01,Tuple{DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},1,1,:Category,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},2,2,:StkID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},3,3,:StkName,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},4,4,:IntlStkID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},5,5,:OnDate,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},6,6,:MarketID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},7,7,:IndustryID,nothing,()},DataStreams.Data.QueryColumn{0x01,Missing,8,8,:CFICode,nothing,()},DataStreams.Data.QueryColumn{0x01,Missing,9,9,:Memo,nothing,()}},(),nothing,nothing}, ::Type{DataStreams.Data.Field}, ::DataFrames.DataFrameStream{Tuple{CategoricalArray{Union{Missing, String},1,UInt32,String,CategoricalString{UInt32},Missing},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},CategoricalArray{Union{Missing, String},1,UInt32,String,CategoricalString{UInt32},Missing},CategoricalArray{Union{Missing, String},1,UInt32,String,CategoricalString{UInt32},Missing},CategoricalArray{Union{Missing, String},1,UInt32,String,CategoricalString{UInt32},Missing},Array{Missing,1},Array{Missing,1}}}, ::DataStreams.Data.Schema{true,Tuple{Union{Missing, CategoricalString{UInt32}},Union{Missing, String},Union{Missing, String},Union{Missing, String},Union{Missing, CategoricalString{UInt32}},Union{Missing, CategoricalString{UInt32}},Union{Missing, CategoricalString{UInt32}},Missing,Missing}}, ::Int64) at /home/dlin/.julia/dev/CSV/src/deprecated.jl:586
[2] #stream!#113(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::CSV.Source{Parsers.Delimited{false,Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}},Parsers.Trie{0x00,false,missing,8,Tuple{Parsers.Trie{0x2c,true,missing,8,Tuple{}},Parsers.Trie{0x0a,true,missing,8,Tuple{}},Parsers.Trie{0x0d,true,missing,8,Tuple{Parsers.Trie{0x0a,true,missing,8,Tuple{}}}}}}},Base.GenericIOBuffer{Array{UInt8,1}},Dates.DateFormat{Symbol("yyyy-mm-dd\\THH:MM:SS.s"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}},Int64}, ::DataStreams.Data.Query{0x01,Tuple{DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},1,1,:Category,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},2,2,:StkID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},3,3,:StkName,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},4,4,:IntlStkID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},5,5,:OnDate,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},6,6,:MarketID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},7,7,:IndustryID,nothing,()},DataStreams.Data.QueryColumn{0x01,Missing,8,8,:CFICode,nothing,()},DataStreams.Data.QueryColumn{0x01,Missing,9,9,:Memo,nothing,()}},(),nothing,nothing}, ::Type{DataFrame}) at /home/dlin/.julia/packages/DataStreams/GjMXN/src/query.jl:588
[3] (::getfield(DataStreams.Data, Symbol("#kw##stream!")))(::NamedTuple{(:append,),Tuple{Bool}}, ::typeof(DataStreams.Data.stream!), ::CSV.Source{Parsers.Delimited{false,Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}},Parsers.Trie{0x00,false,missing,8,Tuple{Parsers.Trie{0x2c,true,missing,8,Tuple{}},Parsers.Trie{0x0a,true,missing,8,Tuple{}},Parsers.Trie{0x0d,true,missing,8,Tuple{Parsers.Trie{0x0a,true,missing,8,Tuple{}}}}}}},Base.GenericIOBuffer{Array{UInt8,1}},Dates.DateFormat{Symbol("yyyy-mm-dd\\THH:MM:SS.s"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}},Int64}, ::DataStreams.Data.Query{0x01,Tuple{DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},1,1,:Category,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},2,2,:StkID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},3,3,:StkName,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, String},4,4,:IntlStkID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},5,5,:OnDate,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},6,6,:MarketID,nothing,()},DataStreams.Data.QueryColumn{0x01,Union{Missing, CategoricalString{UInt32}},7,7,:IndustryID,nothing,()},DataStreams.Data.QueryColumn{0x01,Missing,8,8,:CFICode,nothing,()},DataStreams.Data.QueryColumn{0x01,Missing,9,9,:Memo,nothing,()}},(),nothing,nothing}, ::Type{DataFrame}) at ./none:0
[4] #stream!#111(::Bool, ::Dict{Int64,Function}, ::Function, ::Array{Any,1}, ::Array{Any,1}, ::Nothing, ::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(DataStreams.Data.stream!), ::CSV.Source{Parsers.Delimited{false,Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}},Parsers.Trie{0x00,false,missing,8,Tuple{Parsers.Trie{0x2c,true,missing,8,Tuple{}},Parsers.Trie{0x0a,true,missing,8,Tuple{}},Parsers.Trie{0x0d,true,missing,8,Tuple{Parsers.Trie{0x0a,true,missing,8,Tuple{}}}}}}},Base.GenericIOBuffer{Array{UInt8,1}},Dates.DateFormat{Symbol("yyyy-mm-dd\\THH:MM:SS.s"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}},Int64}, ::Type{DataFrame}) at /home/dlin/.julia/packages/DataStreams/GjMXN/src/query.jl:538
[5] (::getfield(DataStreams.Data, Symbol("#kw##stream!")))(::NamedTuple{(:append, :transforms),Tuple{Bool,Dict{Int64,Function}}}, ::typeof(DataStreams.Data.stream!), ::CSV.Source{Parsers.Delimited{false,Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}},Parsers.Trie{0x00,false,missing,8,Tuple{Parsers.Trie{0x2c,true,missing,8,Tuple{}},Parsers.Trie{0x0a,true,missing,8,Tuple{}},Parsers.Trie{0x0d,true,missing,8,Tuple{Parsers.Trie{0x0a,true,missing,8,Tuple{}}}}}}},Base.GenericIOBuffer{Array{UInt8,1}},Dates.DateFormat{Symbol("yyyy-mm-dd\\THH:MM:SS.s"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}},Int64}, ::Type{DataFrame}) at ./none:0
[6] #read#77(::Bool, ::Dict{Int64,Function}, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String, ::Type{DataFrame}) at /home/dlin/.julia/dev/CSV/src/deprecated.jl:718
[7] read(::String, ::Type{DataFrame}) at /home/dlin/.julia/dev/CSV/src/deprecated.jl:707
[8] top-level scope at none:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment