+ 1
I can't solve average of rows assessment
In Data science courses first code assessment that use numpy library i solve 3 cases but another 2 is hidden and have problem. Can anyone help? https://code.sololearn.com/c7bWxVOohp2F/?ref=app
1 Respuesta
+ 1
Your answer is close to the answer.
n, p = [int(x) for x in input().split()]
import numpy as np
rm = []
for i in range(n):
for a in input().split():
rm.append(float(a))
a = np.array(rm).reshape((n,p))
c = np.mean(a,axis=1)
p = np.around(c,2)
print(p)