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 Answers
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)