there is a way to transform an array x1 of Union{Missing,Float64} to an Array x2 of Float64 without allocating a new array? .x1 doesn’t containg missing values. an example:
x1 = Array{Union{Missing,Float64}}(undef,3)
for i = 1:3
x1[i]=i
end
julia> x1
3-element Array{Union{Missing, Float64},1}:
1.0
2.0
3.0
you can do this by allocating a new array, but there is another way?
a related question, how do i detect that said vector has a missing value?, I’m using in(true,(ismissing.(x)))==true but i’m sure there is a simpler way
Strictly speaking, there is no transformation either but a view, and the result is not an Array{Float64} (that was asked for) but something else.
That said, I think this may be the best solution under some circumstances, as it can be very efficient. So perhaps the original question should have been not how to get an Array{Floa64}, but an array with Float64eltype.