Mean, Var, and Std

Sort by

recency

|

438 Discussions

|

  • + 0 comments

    import numpy N, M = map(int, input().strip().split()) my_arr = numpy.array([input().strip().split()[:M] for _ in range(N)], dtype=numpy.float_) print(numpy.mean(my_arr, axis=1)) print(numpy.var(my_arr, axis=0)) print(round(numpy.std(my_arr, axis = None), 11))

  • + 0 comments

    import numpy

    n , m = map(int,input().split())

    arrayList = [] for i in range(n): arrayList.append(list(map(int,input().split())))

    my_array = numpy.array(arrayList) print(numpy.mean(my_array, axis = 1)) print(numpy.var(my_array, axis = 0)) print(round(numpy.std(my_array, axis = None), 11))

  • + 0 comments

    import numpy as np

    n, m = map(int, input().split())

    array = np.array([list(map(int,input().split())) for _ in range(n)])

    mean = np.mean(array,axis=1)

    var = np.var(array, axis=0)

    std = np.std(array)

    print(mean) print(var) print(f"{std:.11f}")

  • + 0 comments

    import numpy as np

    n,m = map(int, input().split()) a= [] for i in range(n): a.append(list(map(int, input().split()))) print(np.mean(a, axis = 1)) print(np.var(a, axis = 0)) print(round(np.std(a),11))

  • + 0 comments

    n, m = list(map(int, input().strip().split()))

    arr = np.array([list(map(int,(input().strip().split()))) for _ in range(n)])

    print(np.mean(arr, axis=1)) print(np.var(arr, axis=0)) print(round(np.std(arr), 11))