Any idea what how i can work around this error? This is Julia 0.6.
julia> df = CSV.read(file);
MethodError: Cannot `convert` an object of type WeakRefString{UInt8} to an object of type Missings.Missing
This may have arisen from a call to the constructor Missings.Missing(...),
since type constructors fall back to convert methods.
Stacktrace:
[1] setindex!(::Array{Missings.Missing,1}, ::WeakRefString{UInt8}, ::Int64) at ./array.jl:583
[2] streamto!(::DataFrames.DataFrameStream{Tuple{CategoricalArrays.CategoricalArray{Union{Missings.Missing, String},1,UInt32,String,CategoricalArrays.CategoricalString{UInt32},Missings.Missing},Array{Union{Int64, Missings.Mi
Try df = CSV.read(file,rows_for_type_detect=100000). CSV tries to detect the column types, but falls over if it finds a later value that cannot be parsed into the type
load is not a CSVFiles function, it is just reexported from FileIO So you want to either call FileIO.load or just do a using CSVFiles and then simply DataFrame(load(file)). At least I hope that is the bug, if not, could you send over the versions of the packages you are using?
@davidanthoff - you’re right. However, for some reasons, I am sitll unable to load the file (which is not too big, around 700 MiB). It got pegged at 100% cpu for 30 minutes and I gave up. Same thing with TextParse.jl if I use that directly.
CSV.jl does work and it took about 2.5 minutes to load the file.
CSVFiles.jl is not yet ready on julia 1.0 (I only recommended it because the original question mentioned julia 0.6). It runs, but really slowly (as you discovered). There is a nasty performance problem that crept into TextParse.jl when it was ported to julia 1.0, see here. I have no doubt we will be able to fix that, but right now that is there.
@tk3369: did things also not work on julia 0.6, or did you only try on julia 0.7?
Does not work in 0.6 either. It’s been half an hour and still hasn’t finished.
Also, I have to using FileIO or else the load function isn’t defined.