+ 1

1st module project for the DS with Python course

I have made a solution for the 1st module project for the DS with Python course, which asks you to print out the row means of a 2D array. But my solution only passed 3 test cases. Can anyone tell me what's wrong with my code? https://code.sololearn.com/c8dolgQCp1cV/?ref=app

13th Feb 2021, 1:27 AM
Dama Dhananjaya Daliman
Dama Dhananjaya Daliman - avatar
2 Respuestas
+ 2
Based on the problem, you have to round the result into 2 decimals. __________________________________ print(np.mean(ans_arr.reshape(n,p), axis=1).round(2)) __________________________________ Additional: You don't actually need the other for loop inside your for loop as the program is already taking all of the columns by input().split(), that will just make an extra input. https://code.sololearn.com/c8MjZ0p6ilIO/?ref=app
13th Feb 2021, 3:50 AM
noteve
noteve - avatar
+ 1
Thank you for your answer, I totally forgot about the for loop XD
13th Feb 2021, 6:05 AM
Dama Dhananjaya Daliman
Dama Dhananjaya Daliman - avatar