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.

5th Jan 2021, 8:14 PM
Erik Gordon-Quaicoe
Erik Gordon-Quaicoe - avatar
4 Antworten
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?
6th Jan 2021, 3:20 AM
fch0
0
fch0 when i input the rows as stated in the instruction example 1.5 1 i get invalid syntax
6th Jan 2021, 8:02 AM
Erik Gordon-Quaicoe
Erik Gordon-Quaicoe - avatar
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?
6th Jan 2021, 12:25 PM
fch0
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)
1st Mar 2021, 2:37 AM
黄海登
黄海登 - avatar