0 votes
in Python by
Write a function that takes in a list of dictionaries with both a key and list of integers, and returns a dictionary with the standard deviation of each list.

1 Answer

0 votes
by

input = [

    {

        'key': 'list1',

        'values': [4,5,2,3,4,5,2,3],

    },

    {

        'key': 'list2',

        'values': [1,1,34,12,40,3,9,7],

    }

]

output = {'list1': 1.12, 'list2': 14.19}

Hint: Remember the equation for standard deviation. To be able to fulfill this function, we need to use the equation, where we take the sum of the square of the data value minus the mean, over the total number of data points, all within a square root.

...