Mean, Var, and Std

  • + 0 comments

    For Python3 Platform

    It isn't mentioned to round off the standard deviation to 11 decimals. I did that just to match with the given answer.

    from numpy import array, mean, var, std
    
    arr = []
    n, m = map(int, input().split())
    
    for _ in range(n):
        arr.append([*map(int, input().split())])
    arr = array(arr)
    
    print(mean(arr, axis=1))
    print(var(arr, axis=0))
    print(round(std(arr), 11))