Closed
Description
This works:
julia> test = ones(Union{Float64, Missing}, 5,5,5)
julia> test[:, 1:3, 1] .= missing
minimum(test)
returns missing
.
This doesn't work:
x = [rand() < .5 ? missing : rand() for i in 1:100, j in 1:100]
minimum(x)
ERROR: TypeError: non-boolean (Missing) used in boolean context
Stacktrace:
[1] mapreduce_impl(::typeof(identity), ::typeof(min), ::Array{Union{Missing, Float64},2}, ::Int64, ::Int64) at .\reduce.jl:572
[2] _mapreduce(::typeof(identity), ::typeof(min), ::IndexLinear, ::Array{Union{Missing, Float64},2}) at .\reduce.jl:407
[3] _mapreduce_dim at .\reducedim.jl:312 [inlined]
[4] #mapreduce#580 at .\reducedim.jl:307 [inlined]
[5] mapreduce at .\reducedim.jl:307 [inlined]
[6] _minimum at .\reducedim.jl:657 [inlined]
[7] _minimum at .\reducedim.jl:656 [inlined]
[8] #minimum#589 at .\reducedim.jl:652 [inlined]
[9] minimum(::Array{Union{Missing, Float64},2}) at .\reducedim.jl:652
[10] top-level scope at none:0
Me and Peter Deffebach were trying to come up with a MWE. The process made me think that the problem depends on the size of the array. The problem persists for 3 dimensional arrays as well, so I assume it is independent of array dimension.
I'm on Julia 1.4.0, Windows 10.