Let’s see how to calculate standard deviation in Numpy Python module.
Numpy std
It is very easy to calculate standard deviation in Python. With Numpy it is even easier.
There is dedicated function in Numpy module to calculate standard deviation.
import numpy as np my_array = np.array([1, 5, 7, 5, 43, 43, 8, 43, 6]) standard_deviation = np.std(my_array) print("Standard deviation equals: " + str(round(standard_deviation, 2)))