0
Average of Rows end of module project from Data Science
Please Iâm struggling with the input format. I have done it on my pc and it works. Iâve read the instructions over and over Iâm pretty sure Iâm not doing something right. Please can anyone help me? Thank you.
4 RĂ©ponses
0
youâll have to be more specific if you want a useful answer. why donât you start by sharing your work or what you think you might be doing wrong?
0
fch0 when i input the rows as stated in the instruction example 1.5 1 i get invalid syntax
0
invalid syntax is a common error raised in python when thereâs something wrong with your syntax like a missing colon for example, i canât tell you much more than that without knowing whatâs going on, could you paste here the line of your code that is raising it?
0
Data Science - the perfect solution for average of rows
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)