non-numpy weighted mean