Skip to content
DeepForgeby svx
All problems
MediumLinear Algebrala-157

Column Standard Deviation

Problem

Compute the sample standard deviation (denominator n - 1) of each column of data.

Return the standard deviations in column order as floats. Assume at least two samples.

Hint

A zero-variance column has standard deviation 0.0.

Test cases

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

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