Mean, Var, and Std

  • + 0 comments

    My compact solution…

    import sys
    import numpy as np
    
    print((a := np.loadtxt(sys.stdin.readlines()[1:], int)).mean(axis=1),
        a.var(axis=0), a.std().round(11), sep='\n')
    

    It's really very annoying that the results HackerRank expects is based on output using an old version of NumPy. After quickly solving the problem, it takes extra time to adjust it to appear the way they like it.