You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 9, 2024. It is now read-only.
This gem calculates descriptive statistics including measures of central tendency (e.g. mean, median mode), dispersion (e.g. range, and quartiles), and spread (e.g variance and standard deviation).
This gem calculates descriptive statistics including measures of central tendency (e.g. mean, median mode), dispersion
(e.g. range, and quartiles), and spread (e.g variance and standard deviation).
Tested against 2.4.9, 2.5.7, 2.6.5, 2.7.0, ruby-head, jruby-9.1.9.0, jruby-head and rubinius-4.7.
require'descriptive-statistics'moduleEnumerableincludeDescriptiveStatistics# Warning: hacky evil meta programming. Required because classes that have already included# Enumerable will not otherwise inherit the statistics methods.DescriptiveStatistics.instance_methods.eachdo |m|
define_method(m,DescriptiveStatistics.instance_method(m))endend
Then you can use these methods directly on Arrays:
[1,1,2,3,10].mean#=> 3.4
Contributing
Fork it
Create your feature branch (git checkout -b my-new-feature)
Commit your changes (git commit -am 'Add some feature')
Push to the branch (git push origin my-new-feature)
Create new Pull Request
About
This gem calculates descriptive statistics including measures of central tendency (e.g. mean, median mode), dispersion (e.g. range, and quartiles), and spread (e.g variance and standard deviation).