sheriferson / simplestatistics

:game_die: Simple statistical functions implemented in readable Python.
MIT License
96 stars 11 forks source link

Add sample param to Standard Deviation and Coefficient of Variation functions #8

Closed lidimayra closed 8 years ago

lidimayra commented 8 years ago

Boolean param sample in variance() makes it possible to choose between Sample or Population. Although standard_deviation() and coefficient_of_variation() methods calls standard_deviation() to calculate the final result, neither of them passed this param. As sample is the default param in variance(), there was no way to calculate Standard Deviation or Coefficient of Variation for a population dataset.

Changes made in this pull request adds sample param to both. (with default value set to True)

codecov-io commented 8 years ago

Current coverage is 100% (diff: 100%)

Merging #8 into master will not change coverage

@@           master    #8   diff @@
===================================
  Files          32    32          
  Lines         463   463          
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
  Hits          463   463          
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update be10171...f5b9934

sheriferson commented 8 years ago

This is a great improvement to the functions that rely on standard_deviation(). I especially appreciate updating the documentation and tests. Thanks!

Could you extend this improvement to z_scores()? Right now z_scores calls standard_deviation without the ability to specify sample = False.

I'm happy to merge the pull request after that extension.

lidimayra commented 8 years ago

Sure! I can do it right away!! :blush:

sheriferson commented 8 years ago

Awesome! Thanks for the pull request :)

lidimayra commented 8 years ago

My pleasure! :)