You can always convert from one type to the other, in case of
NaN
you can use, e.g.,replace!(x -> isnan(x) ? missing : x, arr)
.
This requires making another copy of data, and makes some kinds of interoperability (when the memory layout is important) impossible inplace.
I guess the way to achieve it is
mapslices(x -> mean(skipmissing(x)), arr, dims=1)
.
Yes, I know about that, but it’s much slower - see an older post of mine.
the DataFrames library has many of such use cases nicely covered
I though that dataframes are basically collections of 1D arrays, so don’t see how it can help with n-dimensional reductions.