• + 0 comments
    def weightedMean(X, W):
        product = sum(list(map(lambda n: n[1] * W[n[0]], enumerate(X))))
        print(f"{product / sum(W):.1f}")