Sample Standard Deviation
Sample Standard Deviation is one of the measures of dispersion that is used to estimate the Population Standard Deviation.
Sample Standard Deviation is calculated by taking positive square of root of the Sample Variance.
The formula for Sample Standard Deviation is
s = ∑(i=1 to n) √ (Xi-X̄)/(n-1)
Method Name
stdev(data)
Method Overview
The python stdev() function takes a sequence or an iterator as the parameter that provides the sample data and returns the standard deviation.
Exceptions
Python raises a StatisticsError if the data passed inside the stdev() function has less than 2 items.
Python example program to find Sample Standard Deviation of a distribution
# import the statistics module
import statistics
sampleData = [120,125,123,126,132,124,122,128]
#Find standard deviation of the sample data
sampleSD = statistics.stdev(sampleData)
print("Standard deviation of the sample data is %.2f"%(sampleSD))Output of a Python example program that finds the Sample Standard Deviation of a distribution
Standard deviation of the sample data is 3.74