1# Calculate standard deviaton based on population/sample
2import numpy as np
3values = [1,5,4,3,3,4]
4# as default, std() calculates basesd on a population
5# by specifying ddof=1, it calculates based on the sample
6np.std(values) # ==1.247219128924647
7np.std(values ,ddof=1) # ==1.3662601021279464
1import numpy as np
2values=[1,10,100]
3print(np.std(values))
4values=[1,10,100,np.nan]
5print(np.nanstd(values))