HackerRank Mean, Var, and Std solution in Python YASH PAL, 31 July 202417 January 2026 HackerRank Mean, Var, and Std solution in Python – In this Mean, Var, and Std problem You are given a 2-D array of size N X M. Your task is to find:The mean along axis 1The var along axis 0The std along axis NoneHackerRank Mean, Var and std problem solution in Python 2.import numpy l=map(int,raw_input().split()) m=[] for i in range(l[0]): m.append(map(int,raw_input().split())) m=numpy.array(m) print numpy.mean(m,axis=1) print numpy.var(m,axis=0) print numpy.std(m,axis=None) Mean, Var, and Std solution in Python 3.import numpy as npn, m = map(int, input().split())k = np.array([input().split() for _ in range(n)],dtype = int)np.set_printoptions(legacy='1.13')print(np.mean(k,axis=1), np.var(k,axis=0), np.std(k), sep='n')Problem solution in pypy programming.# Enter your code here. Read input from STDIN. Print output to STDOUT import numpy n, m = map(int, raw_input().strip().split()) arr = numpy.array([raw_input().split() for _ in range(n)], dtype=int).reshape(n, m) print numpy.mean(arr, axis=1) print numpy.var(arr, axis=0) print numpy.std(arr)Problem solution in pypy3 programming.# Enter your code here. Read input from STDIN. Print output to STDOUT import numpy as np n,m=map(int,input().split()) a = np.array([input().split() for _ in range(n)],dtype=np.float) print(np.mean(a,axis=1)) print(np.var(a,axis=0)) print(np.std(a,axis=None)) coding problems solutions Hackerrank Problems Solutions Python Solutions HackerRankPython