Why does this example (adapted from the DataFrames documentation) work:
julia> x = [1, 2, missing]
3-element Array{Union{Int64, Missings.Missing},1}:
1
2
missing
julia> df = collect(Missings.replace(x, 1))
3-element Array{Int64,1}:
1
2
1
and this not?:
input_file = "/home/js/Downloads/data-1512997404715.csv"
df = CSV.read(input_file, nullable=true)
x = collect(Missings.replace(df, "\\N"))
ERROR: MethodError: no method matching start(::DataFrames.DataFrame)
Closest candidates are:
start(::SimpleVector) at essentials.jl:258
start(::Base.MethodList) at reflection.jl:560
start(::ExponentialBackOff) at error.jl:107
Stacktrace:
[1] copy!(::Array{Any,1}, ::Missings.EachReplaceMissing{DataFrames.DataFrame,String}) at ./abstractarray.jl:573
[2] _collect(::UnitRange{Int64}, ::Missings.EachReplaceMissing{DataFrames.DataFrame,String}, ::Base.HasEltype, ::Base.HasLength) at ./array.jl:437
[3] collect(::Missings.EachReplaceMissing{DataFrames.DataFrame,String}) at ./array.jl:431
I am building a script that create a sql dumpfile from a csv and want to replace all the missing values with "\N"
Regards
Johann