Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

standard deviation in python without numpy

import math

xs = [0.5,0.7,0.3,0.2]     # values (must be floats!)
mean = sum(xs) / len(xs)   # mean
var  = sum(pow(x-mean,2) for x in xs) / len(xs)  # variance
std  = math.sqrt(var)  # standard deviation
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #standard #deviation #python #numpy
ADD COMMENT
Topic
Name
3+7 =