Python Forum

Full Version: how to write a function that accepts a 1D array as a parameter in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
5. Given a 1 D Numpy Array. Write a function that accepts this array as parameters. The method

should return a dictionary with 'mean' and 'std_dev' as key and array's mean and array's

standard deviation as values:

[1, 1, 1]

solution(arr) -> should return :

{'mean': 1.0, 'std_dev': 0.0}