Computing variance, standard deviation in python

635 Views Asked by At

How to calculate data distribution (variance and standard deviation) on Python 3, if the data has > given with atribute Jumlah_individu?

this is my code to calculate mean (I have get it) but for varience and standard deviation i cann't

1

There are 1 best solutions below

0
On

Python has a statistics module. Maybe that'll be helpful.

>>> import statistics as stats
>>> alist = [1,2,3,4,5,6,2,2,2]
>>> stats.median(alist)
2
>>> stats.mode(alist)
2
>>> stats.mean(alist)
3