0
Test Cases 4 and 5 in the first Data Science's Code Project remain hidden. Any help?
Hello, I'm trying to solve Code Project "Average Rows" in Data Science course, but Test Case 4 and 5 remain hidden, so I cannot know what I'm doing wrong. Someone could help me?
5 Réponses
+ 6
Alberto Sburlino Not by guessing. Pls edit your question description and add:
1. A task description
2. A link to your code in Code Playground (use "+" button)
+ 4
Upload a private code
https://code.sololearn.com/Wek0V1MyIR2r/?ref=app
+ 1
Read carefully the "output format" spec: "...rounded to the second decimal".
Side hint: arrays don't need to be initialized, just declared. So the line "means = list(range(n))" is overkill.
0
Where is your code
0
THE CODE: https://code.sololearn.com/c60aFZg89N79/?ref=app
THE QUESTION:
In a matrix, or 2-d array X, the averages (or means) of the elements of rows is called row means.
Task
Given a 2D array, return the rowmeans.
Input Format
First line: two integers separated by spaces, the first indicates the rows of matrix X (n) and the second indicates the columns of X (p)
Next n lines: values of the row in X
Output Format
An numpy 1d array of values rounded to the second decimal.
2 2
1.5 1
2 2.9
Sample Output
[1.25 2.45]