How to calculate a weighted mean with missing observations

Thanks for that link. But to be clear I think that’s not the way to go.

That PR fixes mapreduce and the functions that use it like sum and prod, but you’d have to do the same for reduce. And mean doesn’t actually use mapreduce as far as I can tell, so you’d have to fix that as well. How many others are there? On top of that, StaticArrays has to reimplement these functions with dims arguments as well, so there’s even more implementation cost and opportunity for bugs. All of this could be avoided by just not having the dims keyword arguments and using the eachslice API to separate these concerns.