Skip to content
DeepForgeby svx
All problems
EasyLinear Algebrala-145

Row Means

Problem

Compute the mean of each row of data.

Return a list where entry i is the arithmetic mean of row i, as floats.

Hint

Each row is averaged independently.

Test cases

case 1
in: [[[1,2,3],[4,5,6]]]
expected: [2,5]
case 2
in: [[[1,1],[0,0]]]
expected: [1,0]
case 3
in: [[[2.5,3.5]]]
expected: [3]
case 4
in: [[[0]]]
expected: [0]
Starter codePython
def row_means(data):
    # Your code here
    pass

4 test cases · run your code against them in the editor