We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 1: Standard Deviation
Day 1: Standard Deviation
Sort by
recency
|
426 Discussions
|
Please Login in order to post a comment
Considering that finite sequences of inputs typically are samples from a population, the correct answer should be the implementation of the sample standard deviation,
i.e. s = Sqrt{ Sum [((x_i-mu)^2)/(N-1)]}.
import statistics as st def stdDev(arr): m = st.mean(arr) s = [ (i-m)**2 for i in arr ] return print(f"{(sum(s)/len(arr))**0.5:.1f}") `