need help solving 1st project in the data science course | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

need help solving 1st project in the data science course

Hi, I am trying to do the first project in the data science course, but my code does not pass the last two tests, and I have no idea why. Has anyone any idea or could give some help on how to find out what those tests could be testing? Thanks in advance for your help! Here is my code: import numpy as np n, p = [int(x) for x in input().split()] arr = np.array([]) for i in range(n): r = np.array([round(float(x),2) for x in input().split()]) if arr.any(): arr = np.vstack((arr, r)) else: arr = r print(np.mean(arr, axis=1))

5th Apr 2023, 1:25 PM
Emma
Emma - avatar
4 Answers
+ 2
import numpy as np n, p = [int(x) for x in input().split()] X= np.empty([n, p]) for i in range(n): X[i,] = input().split() print(np.around(X.mean(axis=1),2))
5th Apr 2023, 2:05 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
+ 1
What is the error message?
5th Apr 2023, 1:31 PM
KfirWe
KfirWe - avatar
+ 1
There is no error message. I just get three green ticks for the three first tests, and two red ticks for the last two tests, that's it. I dont know how to figure out what is missing in my code to pass those last two tests as they are hidden.
5th Apr 2023, 1:45 PM
Emma
Emma - avatar
+ 1
Thanks! I hadnt thought of adding another rounding on the final printed array. Now it is working. Thank you!
5th Apr 2023, 2:09 PM
Emma
Emma - avatar