-1

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

smci
  • 32,567
  • 20
  • 113
  • 146
dodo
  • 13
  • 1
  • 1
  • 7
  • Please post your code, not an image of the code. Also we need to know what `data` is: a pandas dataframe? numpy ndarray? list-of-lists? Please show `data.info()` – smci Oct 03 '18 at 00:50
  • Ok it's pandas since you reference the column by `data.jumlah_individu` – smci Oct 03 '18 at 17:00

1 Answers1

1

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
slider
  • 12,810
  • 1
  • 26
  • 42