I am trying to find the maximum element across the 2nd dim of a matrix with missing values.
This code unfortunatelly gives an error:
A = [1 missing 3; 4 5 missing; 7 8 9]
B = maximum(skipmissing(A), dims=2)
ERROR: LoadError: MethodError: no method matching
maximum(::Base.SkipMissing{Array{Union{Missing, Int64},2}}; dims=2)
My questions is: shouldn’t this work?
I found another way of doing it but is not as clean:
B = [ maximum(skipmissing(row)) for row in eachrow(A) ]