Open eirikbrandsaas opened 2 years ago
Works with floats. I would guess some call to similar
that isnt correct.
julia> b = [missing missing; 0.0 1.0]
2×2 Matrix{Union{Missing, Float64}}:
missing missing
0.0 1.0
julia> mean(b, dims = 2)
2×1 Matrix{Union{Missing, Float64}}:
missing
0.5
Error is this line
julia> Statistics._mean_promote(missing, 1)
1
julia> 1/1
1.0
julia> missing / 1
missing
The solution is probably to add more f(x) / 1
checks to get the output type right, since missing / 1
is not informative of what the output should be the same way 1/1
is. We could also add a skipmissing
or something, though that is likely quite costly.
The answer should be [missing, 0.5].
Note that
works.