Interview Query

Compute Deviation

Start Timer

0:00:00

Upvote
43
Downvote
Save question
Mark as completed
View comments (77)
Next question

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}
.
.
.
.
.


Comments

Loading comments