Interview Query

Compute Deviation

26
Have you seen this question before?

Write a function compute_deviation that takes in a list of dictionaries with a key and list of integers and returns a dictionary with the standard deviation of each list.

Note: This should be done without using the NumPy built-in functions.

Example:

Input:

input = [
    {
        'key': 'list1',
        'values': [4,5,2,3,4,5,2,3],
    },
    {
        'key': 'list2',
        'values': [1,1,34,12,40,3,9,7],
    }
]

Output:

 output = {'list1': 1.12, 'list2': 14.19}
Next question: Longest Streak Users
.....
Python 3.9.6
Loading editor
Use Shift + Enter to run code