{"id":34039822,"url":"https://github.com/sheriferson/simplestatistics","last_synced_at":"2026-03-17T22:40:32.204Z","repository":{"id":8554223,"uuid":"10178184","full_name":"sheriferson/simplestatistics","owner":"sheriferson","description":":game_die: Simple statistical functions implemented in readable Python.","archived":false,"fork":false,"pushed_at":"2023-04-19T06:34:22.000Z","size":262,"stargazers_count":97,"open_issues_count":0,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-20T14:57:04.446Z","etag":null,"topics":["python","simplestatistics","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheriferson.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-20T17:42:41.000Z","updated_at":"2025-06-02T08:51:35.000Z","dependencies_parsed_at":"2022-09-19T05:32:07.585Z","dependency_job_id":null,"html_url":"https://github.com/sheriferson/simplestatistics","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sheriferson/simplestatistics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheriferson%2Fsimplestatistics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheriferson%2Fsimplestatistics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheriferson%2Fsimplestatistics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheriferson%2Fsimplestatistics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheriferson","download_url":"https://codeload.github.com/sheriferson/simplestatistics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheriferson%2Fsimplestatistics/sbom","scorecard":{"id":817890,"data":{"date":"2025-08-11","repo":{"name":"github.com/sheriferson/simplestatistics","commit":"940ea6dae98a017b22e02c77cf4bd87c36f6a558"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T14:38:42.336Z","repository_id":8554223,"created_at":"2025-08-23T14:38:42.336Z","updated_at":"2025-08-23T14:38:42.336Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T22:38:22.569Z","status":"ssl_error","status_checked_at":"2026-03-17T22:38:11.804Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","simplestatistics","statistics"],"created_at":"2025-12-13T21:51:16.156Z","updated_at":"2026-03-17T22:40:32.194Z","avatar_url":"https://github.com/sheriferson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simplestatistics\n\n[![Circle CI](https://circleci.com/gh/sheriferson/simplestatistics.svg?style=svg)](https://circleci.com/gh/sheriferson/simplestatistics)\n[![codecov](https://codecov.io/gh/sheriferson/simplestatistics/branch/master/graph/badge.svg)](https://codecov.io/gh/sheriferson/simplestatistics)\n[![Documentation Status](https://readthedocs.org/projects/simplestatistics/badge/?version=latest)](http://simplestatistics.readthedocs.io/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/simplestatistics.svg)](https://badge.fury.io/py/simplestatistics)\n\n[simple-statistics](https://github.com/tmcw/simple-statistics)\nfor Python.\n\n`simplestatistics` is compatible with Python 3.\n\n[Version 0.4.0][0.4] was the last version to not use Python 3 specific features. Going forward, `simplestatistics` will adopt Python 3 features (e.g., [type hints]).\n\n[0.4]: https://pypi.org/project/simplestatistics/0.4.0/ \"simplestatistics 0.4.0 on PyPI\"\n[type hints]: https://docs.python.org/3/library/typing.html \"Python 3 type hints documentation\"\n\n\u003c!-- TOC --\u003e\n\n## Installation\n\nInstall the [current PyPI release](https://pypi.python.org/pypi/simplestatistics):\n\n```bash\npip install simplestatistics\n```\n\nOr install the development version from GitHub:\n\n```bash\npip install git+https://github.com/sheriferson/simplestatistics\n```\n\n## Usage\n\n```python\n\u003e\u003e\u003e import simplestatistics as ss\n\u003e\u003e\u003e ss.mean([1, 2, 3])\n2.0\n\u003e\u003e\u003e ss.t_test([1, 2, 2.4, 3, 0.9], 2)\n-0.3461277235039039\n```\n\n## Documentation\n\nYou can [read the documentation online](http://simplestatistics.readthedocs.io/en/latest/).\n\nOr you can generate it yourself:\n\nInside `simplestatistics/`.\n\n```bash\nmake html\n```\n\nDocumentation will be generated in `_build/html/`.\n\n## Tests\n\nTo run all doctests and see test coverage:\n\n```bash\npip install -r requirements.txt\npytest simplestatistics --doctest-modules --cov=simplestatistics\n```\nThe code adheres to [PEP8] guidelines except for the following checkers:\n\n- `invalid-name`\n- `len-as-condition`\n- `superfluous-parens`\n- `unidiomatic-typecheck`\n\n[PEP8]: https://www.python.org/dev/peps/pep-0008/ \"PEP 8 -- Style Guide for Python Code\"\n\nTo [lint] the code, make sure you have [`pylint`] installed (`pip install pylint`), `cd` into the `simplestatistics/statistics` directory, then run:\n\n```bash\npylint -d 'invalid-name, len-as-condition, superfluous-parens, unidiomatic-typecheck' *.py\n```\n\n[lint]: https://en.wikipedia.org/wiki/Lint_%28software%29 \"Linting Wikipedia page\"\n[pylint]: https://pylint.org \"Pylint website\"\n\n## Functions and examples\n\n### Descriptive statistics\n\n| Function      | Example                                                          |\n|---------------|------------------------------------------------------------------|\n| [Min][]       | `min([-3, 0, 3])`                                                |\n| [Max][]       | `max([1, 2, 3])`                                                 |\n| [Sum][]       | `sum([1, 2, 3.5])`                                               |\n| [Quantiles][] | `quantile([3, 6, 7, 8, 8, 9, 10, 13, 15, 16, 20], [0.25, 0.75])` |\n| [Product][]   | `product([1.25, 2.75], [2.5, 3.40])`                             |\n\n[Min]: http://simplestatistics.readthedocs.io/en/latest/#min\n[Max]: http://simplestatistics.readthedocs.io/en/latest/#max\n[Sum]: http://simplestatistics.readthedocs.io/en/latest/#sum\n[Quantiles]: http://simplestatistics.readthedocs.io/en/latest/#quantiles\n[Product]: http://simplestatistics.readthedocs.io/en/latest/#product\n\n### Measures of central tendency\n\n| Function             | Example                            |\n|----------------------|------------------------------------|\n| [Mean][]             | `mean([1, 2, 3])`                  |\n| [Median][]           | `median([10, 2, -5, -1])`          |\n| [Mode][]             | `mode([2, 1, 3, 2, 1])`            |\n| [Geometric mean][]   | `geometric_mean([1, 10])`          |\n| [Harmonic mean][]    | `harmonic_mean([1, 2, 4])`         |\n| [Root mean square][] | `root_mean_square([1, -1, 1, -1])` |\n| [Add to mean][]      | `add_to_mean(40, 4, (10, 12))`     |\n| [Skewness][]         | `skew([1, 2, 5])`                  |\n| [Kurtosis][]         | `kurtosis([1, 2, 3, 4, 5])`        |\n\n[Mean]: http://simplestatistics.readthedocs.io/en/latest/#mean\n[Median]: http://simplestatistics.readthedocs.io/en/latest/#median\n[Mode]: http://simplestatistics.readthedocs.io/en/latest/#mode\n[Geometric mean]: http://simplestatistics.readthedocs.io/en/latest/#geometric-mean\n[Harmonic mean]: http://simplestatistics.readthedocs.io/en/latest/#harmonic-mean\n[Root mean square]: http://simplestatistics.readthedocs.io/en/latest/#root-mean-square\n[Add to mean]: http://simplestatistics.readthedocs.io/en/latest/#add-to-mean\n[Skewness]: http://simplestatistics.readthedocs.io/en/latest/#skewness\n[Kurtosis]: http://simplestatistics.readthedocs.io/en/latest/#kurtosis\n\n### Measures of dispersion\n\n| Function                                                    | Example                                               |\n|-------------------------------------------------------------|-------------------------------------------------------|\n| [Sample and population variance][variance]                  | `variance([1, 2, 3], sample = True)`                  |\n| [Sample and population Standard deviation][sd]              | `standard_deviation([1, 2, 3], sample = True)`        |\n| [Sample and population Coefficient of variation][cv]        | `coefficient_of_variation([1, 2, 3], sample = True)`  |\n| [Interquartile range][]                                     | `interquartile_range([1, 3, 5, 7])`                   |\n| [Sum of Nth power deviations][sumndevs]                     | `sum_nth_power_deviations([-1, 0, 2, 4], 3)`          |\n| [Sample and population Standard scores (z-scores)][zscores] | `z_scores([-2, -1, 0, 1, 2], sample = True)`          |\n\n[variance]: http://simplestatistics.readthedocs.io/en/latest/#variance\n[sd]: http://simplestatistics.readthedocs.io/en/latest/#standard-deviation\n[cv]: http://simplestatistics.readthedocs.io/en/latest/#coefficient-of-variation\n[Interquartile range]: http://simplestatistics.readthedocs.io/en/latest/#interquartile-range\n[sumndevs]: http://simplestatistics.readthedocs.io/en/latest/#sum-of-nth-power-deviations\n[zscores]: http://simplestatistics.readthedocs.io/en/latest/#standard-scores-z-scores\n\n### Linear regression\n\n| Function                                                | Example                                                     |\n|---------------------------------------------------------|-------------------------------------------------------------|\n| [Simple linear regression][linreg]                      | `linear_regression([1, 2, 3, 4, 5], [4, 4.5, 5.5, 5.3, 6])` |\n| [Linear regression line function generator][linregline] | `linear_regression_line([.5, 9.5])([1, 2, 3])`              |\n\n[linreg]: http://simplestatistics.readthedocs.io/en/latest/#linear-regression\n[linregline]: http://simplestatistics.readthedocs.io/en/latest/#linear-regression-line-function\n\n### Similarity\n\n| Function        | Example                                                              |\n|-----------------|----------------------------------------------------------------------|\n| [Correlation][] | `correlate([2, 1, 0, -1, -2, -3, -4, -5], [0, 1, 1, 2, 3, 2, 4, 5])` |\n| [Covariance][]  | `covariance([1,2,3,4,5,6], [6,5,4,3,2,1])`                           |\n\n[Correlation]: http://simplestatistics.readthedocs.io/en/latest/#correlation\n[Covariance]: http://simplestatistics.readthedocs.io/en/latest/#covariance\n\n### Distributions\n\n| Function                           | Example                                                |\n|------------------------------------|--------------------------------------------------------|\n| [Factorial][]                      | `factorial(20)` or `factorial([1, 5, 20])`             |\n| [Choose][]                         | `choose(5, 3)`                                         |\n| [Normal distribution][]            | `normal(4, 8, 2)` or `normal([1, 4], 8, 2)`            |\n| [Binomial distribution][]          | `binomial(4, 12, 0.2)` or `binomial([3,4,5], 12, 0.5)` |\n| [Bernoulli distribution][]         | `bernoulli(0.25)`                                      |\n| [Poisson distribution][]           | `poisson(3, [0, 1, 2, 3])`                             |\n| [Gamma function][]                 | `gamma_function([1, 2, 3, 4, 5])`                      |\n| [Beta distribution][]              | `beta([.1, .2, .3], 5, 2)`                             |\n| [One-sample t-test][]              | `t_test([1, 2, 3, 4, 5, 6], 3.385)`                    |\n| [Chi Squared Distribution Table][] | `chi_squared_dist_table(k = 10, p = .01)`              |\n\n[Factorial]: http://simplestatistics.readthedocs.io/en/latest/#factorial\n[Choose]: http://simplestatistics.readthedocs.io/en/latest/#choose\n[Normal distribution]: http://simplestatistics.readthedocs.io/en/latest/#normal-distribution\n[Binomial distribution]: http://simplestatistics.readthedocs.io/en/latest/#binomial-distribution\n[Bernoulli distribution]: http://simplestatistics.readthedocs.io/en/latest/#bernoulli-distribution\n[Poisson distribution]: http://simplestatistics.readthedocs.io/en/latest/#poisson-distribution\n[Gamma function]: http://simplestatistics.readthedocs.io/en/latest/#gamma-function\n[Beta distribution]: http://simplestatistics.readthedocs.io/en/latest/#beta-distribution\n[One-sample t-test]: http://simplestatistics.readthedocs.io/en/latest/#one-sample-t-test\n[Chi Squared Distribution Table]: http://simplestatistics.readthedocs.io/en/latest/#chi-squared-distribution-table\n\n### Classifiers\n\n| Function                         | Example                                                      |\n|----------------------------------|--------------------------------------------------------------|\n| [Naive Bayesian classifier][nbc] | See documentation for examples of how to train and classify. |\n| [Perceptron][]                   | See documentation for examples of how to train and classify. |\n\n[nbc]: http://simplestatistics.readthedocs.io/en/latest/#bayesian-classifier\n[Perceptron]: http://simplestatistics.readthedocs.io/en/latest/#perceptron\n\n### Errors\n\n| Function                    | Example             |\n|-----------------------------|---------------------|\n| [Gauss error function][gef] | `error_function(1)` |\n\n[gef]: http://simplestatistics.readthedocs.io/en/latest/#error-function\n\n### Hyperbolic functions\n\n| Function      | Example     |\n|---------------|-------------|\n| [sinh][hyper] | `sinh(2)`   |\n| [cosh][hyper] | `cosh(2.5)` |\n| [tanh][hyper] | `tanh(.2)`  |\n\n[hyper]: https://en.wikipedia.org/wiki/Hyperbolic_function#Other_definitions\n\n## Spirit and rules\n\n- Everything should be implemented in raw, organic, locally sourced Python.\n- Use libraries only if you have to and only when unrelated to the math/statistics. For example, `from functools import reduce` to make `reduce` available for those using python3. That's okay, because it's about making Python work and not about making the stats easier.\n- It's okay to use operators and functions if they correspond to regular calculator buttons. For example, all calculators have a built-in square root function, so there is no need to implement that ourselves, we can use `math.sqrt()`.\nAnything beyond that, like `mean`, `median`, we have to write ourselves.\n\nPull requests are welcome!\n\n## Contributors\n\n- Jim Anderson ([jhowardanderson](https://github.com/jhowardanderson))\n- Lidiane Taquehara ([lidimayra](https://github.com/lidimayra))\n- Pierre-Selim ([PierreSelim](https://github.com/PierreSelim))\n- Tom MacWright ([tmcw](https://github.com/tmcw))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheriferson%2Fsimplestatistics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheriferson%2Fsimplestatistics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheriferson%2Fsimplestatistics/lists"}