how to write a program about standard deviation without importing statistics

  Kiến thức lập trình

I tried to write a program about standard deviation without importing statistics. And then I compered it to the ‘real’ standard deviation, but it isn’t corresponding.

this is my coding

import math as sqrt

def media:

m=sum(x)//len(x)

def st_dev:

d=sqrt((sum(len(x)-media(x))**2)/len(x))

return d

New contributor

Meli is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT