In addtion to sylvaticus’ very important points, I have two comments
- The stats functions like
meanetc. are not inBasebut inStatistics - The
Tin your dispatch should beUnion{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