I try to run this code
## remove NaNs
df_food[:gpa] =
collect(FltOrMiss, map(x -> isnan(x)?missing:x, df_food[:gpa]))
df_food[:wgt] =
collect(FltOrMiss, map(x -> isnan(x)?missing:x, df_food[:wgt]))
But get this error:
TypeError: non-boolean (Missing) used in boolean context
Stacktrace:
[1] #40 at ./In[31]:1 [inlined]
[2] iterate at ./generator.jl:47 [inlined]
[3] collect_to!(::Array{Float64,1}, ::Base.Generator{Array{Union{Missing, Float64},1},getfield(Main, Symbol("##40#41"))}, ::Int64, ::Int64) at ./array.jl:656
[4] collect_to_with_first! at ./array.jl:643 [inlined]
[5] _collect(::Array{Union{Missing, Float64},1}, ::Base.Generator{Array{Union{Missing, Float64},1},getfield(Main, Symbol("##40#41"))}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:637
[6] collect_similar(::Array{Union{Missing, Float64},1}, ::Base.Generator{Array{Union{Missing, Float64},1},getfield(Main, Symbol("##40#41"))}) at ./array.jl:561
[7] map(::Function, ::Array{Union{Missing, Float64},1}) at ./abstractarray.jl:1987
[8] top-level scope at In[31]:1
How can i solve this unexpected error.