Hello,
according doc
In many cases, missing values will have to be skipped or replaced with a valid value. For example, sum([1, missing]) returns missing due to the behavior of +. Use sum(Missings.skip([1, missing]) to ignore missing values.
using Missings
sum(Missings.skip([1, missing])
is problematic (ending parenthesis is missing) but
sum(Missings.skip([1, missing]))
raises
ERROR: MethodError: no method matching skip(::Array{Union{Missing, Int64},1})
Doc (and maybe code also) should be fixed.
Maybe it should be
julia> sum(filter(!ismissing, [1, missing, 2]))
3
or with iterator
julia> sum(Iterators.filter(!ismissing, [1, missing, 2]))
3
I will personally define Missings.skip like
julia> skip(a, Missing) = Iterators.filter(!ismissing, a)
skip (generic function with 1 method)
julia> sum(skip([1, missing, 2], missing))
3
Kind regards
Hello,
according doc
is problematic (ending parenthesis is missing) but
raises
Doc (and maybe code also) should be fixed.
Maybe it should be
or with iterator
I will personally define
Missings.skiplikeKind regards