-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
missing dataBase.missing and related functionalityBase.missing and related functionality
Description
MWE:
julia> using LinearAlgebra
julia> x = [5, 6, missing];
julia> w = [1, 2, 3];
julia> dot(x, w)
ERROR: MethodError: no method matching iterate(::Missing)
Closest candidates are:
iterate(::Union{LinRange, StepRangeLen}) at range.jl:664
iterate(::Union{LinRange, StepRangeLen}, ::Int64) at range.jl:664
iterate(::T) where T<:Union{Base.KeySet{var"#s79", var"#s78"} where {var"#s79", var"#s78"<:Dict}, Base.ValueIterator{var"#s77"} where var"#s77"<:Dict} at dict.jl:693
...
Stacktrace:
[1] ⋮ internal
@ LinearAlgebra
[2] dot(x::Vector{Union{Missing, Int64}}, y::Vector{Int64})
@ LinearAlgebra C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\LinearAlgebra\src\generic.jl:916
Use `err` to retrieve the full stack trace.I would have assumed that the dot should yield missing.
For reference, I came across this using StatsBase.mean(x, weights(w)).
pdeffebach, matthieugomez and juliohm
Metadata
Metadata
Assignees
Labels
missing dataBase.missing and related functionalityBase.missing and related functionality