Hello,
I am trying to read in space separated files, but I am getting a ReadOnlyMemoryError when calling CSV.read.
My minimum working example runs fine on my laptop, but it fails on my desktop. I am using Julia 1.1.1 and Ubuntu 16.04.6 on both.
It successfully reads in data with 3 columns and 5000 rows (the pos_mwe.txt file) but fails when reading a 5000x5000 space delimited file (the VwF_mwe.txt file). As far as I can tell the data files are not the problem, which seems to be corroborated by the fact that they run fine on my laptop.
What could be the problem here, and why will it work on my laptop but not desktop? Iâm new to Julia but this seems very strange. Thanks!
Here is the example:
using DelimitedFiles
using CSV
using DataFrames
function mwe_memory_error()
pos = Array{Float64}(undef, 5000, 3)
pos = CSV.read(âpos_mwe.txtâ, header=false, delim=â ')
println(âpast position file readâ)
F = Array{Float64}(undef, 5000, 5000)
F = CSV.read(âVwF_mwe.txtâ, header=false, delim=â ')
println(âpast view factor file readâ)
end;
And here is the error output:
julia> mwe_memory_error()
past position file read
ERROR: ReadOnlyMemoryError()
Stacktrace:
[1] setindex! at ./array.jl:767 [inlined]
[2] parsevalue!(::Type{Float64}, ::Int8, ::Array{UInt64,1}, ::Int64, ::Array{UInt8,1}, ::Int64, ::Int64, ::Parsers.Options{false,true,false,Missing,UInt8,Nothing}, ::Int64, ::Int64, ::Array{Int8,1}) at /home/odak6/.julia/packages/CSV/2IO2Z/src/CSV.jl:466
[3] parsetape(::Val{false}, ::Int64, ::Dict{Int8,Int8}, ::Array{UInt64,1}, ::Array{UInt8,1}, ::Int64, ::Int64, ::Int64, ::Nothing, ::Array{Int64,1}, ::Float64, ::Array{Dict{String,UInt64},1}, ::Array{UInt64,1}, ::Int64, ::Array{Int8,1}, ::Bool, ::Parsers.Options{false,true,false,Missing,UInt8,Nothing}) at /home/odak6/.julia/packages/CSV/2IO2Z/src/CSV.jl:271
[4] #File#20(::Bool, ::Bool, ::Int64, ::Nothing, ::Int64, ::Int64, ::Bool, ::Nothing, ::Bool, ::Array{String,1}, ::String, ::Char, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::Nothing, ::UInt8, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Int8,Int8}, ::Bool, ::Float64, ::Bool, ::Bool, ::Bool, ::Bool, ::Nothing, ::Type, ::String) at /home/odak6/.julia/packages/CSV/2IO2Z/src/CSV.jl:232
[5] (::getfield(Core, Symbol(â#kw#Typeâ)))(::NamedTuple{(:header, :delim),Tuple{Bool,Char}}, ::Type{CSV.File}, ::String) at ./none:0
[6] #read#63 at /home/odak6/.julia/packages/CSV/2IO2Z/src/CSV.jl:559 [inlined]
[7] #read at ./none:0 [inlined]
[8] mwe_memory_error() at /home/odak6/Evan/PP_VwF/MWE_memory_error/mwe_memory_error.jl:13
[9] top-level scope at none:0