Mean and empty collection

mean behaves very inconsistently with empty collections, is this intentional?

julia> y = Union{Missing, Float64}[missing, missing, missing]

julia> mean(skipmissing(y))
ERROR: ArgumentError: mean of empty collection undefined: Base.SkipMissing{Array{Union{Missing, Float64},1}}(Union{Missing, Float64}[missing, missing, missing])

julia> mean(Float64[])

julia> mean(Int64[])

julia> mean([])
ERROR: MethodError: no method matching zero(::Type{Any})


1 Like

thanks for the hint.

I am working on a PR to fix this.