Dipatch on AbstractArray which contains missing values

In addtion to sylvaticus’ very important points, I have two comments

  1. The stats functions like mean etc. are not in Base but in Statistics
  2. The T in your dispatch should be Union{Missing, T}

But IMHO it’s really much simpler and clearer to be explicit about it at the expense of a few extra characters

import Base: skipmissing as sm
mean(sm([missing,1])) = 1.0
1 Like