{"id":22555642,"url":"https://github.com/prjemian/pysumreg","last_synced_at":"2025-03-28T11:12:51.246Z","repository":{"id":63815537,"uuid":"570691554","full_name":"prjemian/pysumreg","owner":"prjemian","description":"Statistics of list of (x, y) pairs from calculator-style summation registers.","archived":false,"fork":false,"pushed_at":"2024-02-15T08:50:19.000Z","size":1764,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-16T08:54:04.973Z","etag":null,"topics":["fitting","regression","statistics"],"latest_commit_sha":null,"homepage":"https://prjemian.github.io/pysumreg/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prjemian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-11-25T20:50:08.000Z","updated_at":"2024-04-15T15:54:39.294Z","dependencies_parsed_at":"2024-04-15T16:07:54.360Z","dependency_job_id":null,"html_url":"https://github.com/prjemian/pysumreg","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjemian%2Fpysumreg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjemian%2Fpysumreg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjemian%2Fpysumreg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjemian%2Fpysumreg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prjemian","download_url":"https://codeload.github.com/prjemian/pysumreg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246017731,"owners_count":20710240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fitting","regression","statistics"],"created_at":"2024-12-07T19:08:29.889Z","updated_at":"2025-03-28T11:12:51.225Z","avatar_url":"https://github.com/prjemian.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Statistics with Calculator-style Summation Registers\n\nStatistics of list of (x, y) pairs from calculator-style summation registers.\n\nCONTENTS\n\n- [Statistics with Calculator-style Summation Registers](#statistics-with-calculator-style-summation-registers)\n  - [Why use this package?](#why-use-this-package)\n  - [Examples](#examples)\n    - [mean and standard deviation](#mean-and-standard-deviation)\n    - [linear regression \\\u0026 correlation coefficient](#linear-regression--correlation-coefficient)\n    - [peak analysis: centroid and width of x weighted by y](#peak-analysis-centroid-and-width-of-x-weighted-by-y)\n  - [Installation](#installation)\n  - [About](#about)\n\n## Why use this package?\n\nUse this package to obtain summary statistics of a list of $(x, y)$ pairs when\nthe pairs are presented in sequence, such as from a control system.  It is not\nnecessary to retain the entire list in memory, this package will retain the\ncumulative values necessary to compute all analytical results.\n\nThere are no external dependencies on add-on packages such as numpy or\nscipy.  Only the [math](https://docs.python.org/3/library/math.html) package\nfrom the Python Standard Library is used.\n\nStatistics may be calculated at any time from the summation registers.\n\nThe $(x, y)$ values may be entered in any order.  It is not necessary to\nsort them.\n\n## Examples\n\n```python\nIn [1]: import pysumreg\n\nIn [2]: reg = pysumreg.SummationRegisters()\n```\n\n### mean and standard deviation\n\n```python\nIn [3]: reg.clear()\n   ...: reg.add(1, -1)\n   ...: reg.add(2, -2)\n   ...: reg.add(3, -3)\n   ...: print(f\"{reg.mean_x=}\")\n   ...: print(f\"{reg.stddev_x=}\")\n   ...: print(f\"{reg.mean_y=}\")\n   ...: print(f\"{reg.stddev_y=}\")\n   ...: print(f\"{reg.min_x=}\")\n   ...: print(f\"{reg.max_x=}\")\n   ...: print(f\"{reg.min_y=}\")\n   ...: print(f\"{reg.max_y=}\")\n   ...: print(f\"{reg.x_at_max_y=}\")\n   ...: print(f\"{reg.x_at_min_y=}\")\n   ...: \nreg.mean_x=2.0\nreg.stddev_x=1.0\nreg.mean_y=-2.0\nreg.stddev_y=1.0\nreg.min_x=1\nreg.max_x=3\nreg.min_y=-3\nreg.max_y=-1\nreg.x_at_max_y=1\nreg.x_at_min_y=3\n```\n\n### linear regression \u0026 correlation coefficient\n\n```python\nIn [4]: reg.clear()\n   ...: reg.add(1, -1)\n   ...: reg.add(2, -2)\n   ...: reg.add(3, -3)\n   ...: print(f\"{reg.correlation=}\")\n   ...: print(f\"{reg.intercept=}\")\n   ...: print(f\"{reg.slope=}\")\n   ...: \nreg.correlation=-1.0\nreg.intercept=0.0\nreg.slope=-1.0\n```\n\n### peak analysis: centroid and width of x weighted by y\n\n```python\nIn [5]: reg.clear()\n   ...: reg.add(1, 0)\n   ...: reg.add(2, 1)\n   ...: reg.add(3, 0)\n   ...: print(f\"{reg.max_y=}\")\n   ...: print(f\"{reg.centroid=}\")\n   ...: print(f\"{reg.sigma=}\")\n   ...: \nreg.max_y=1\nreg.centroid=2.0\nreg.sigma=0.0\n\nIn [6]: reg.add(1.5, 0.5)\n   ...: reg.add(2.5, 0.5)\n   ...: print(f\"{reg.max_y=}\")\n   ...: print(f\"{reg.centroid=}\")\n   ...: print(f\"{reg.sigma=}\")\n   ...: \nreg.max_y=1\nreg.centroid=2.0\nreg.sigma=0.3535533905932738\n```\n\n## Installation\n\nThis package may be installed by any of these commands:\n\n- `pip install pysumreg`\n- `conda install -c conda-forge pysumreg`\n- `mamba install -c conda-forge pysumreg`\n- `micromamba install -c conda-forge pysumreg`\n\n## About\n\n| Release | PyPI | Conda-forge | Platforms |\n| --- | --- | --- | --- |\n| [![Release](https://img.shields.io/github/release/prjemian/pysumreg.svg)](https://github.com/prjemian/pysumreg/releases) | [![PyPI](https://img.shields.io/pypi/v/pysumreg.svg)](https://pypi.python.org/pypi/pysumreg) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/pysumreg.svg)](https://anaconda.org/conda-forge/pysumreg) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/pysumreg.svg)](https://anaconda.org/conda-forge/pysumreg) |\n\n| Python | Unit Tests | Code Coverage |\n| --- | --- | --- |\n| [![Python](https://img.shields.io/pypi/pyversions/pysumreg.svg)](https://pypi.python.org/pypi/pysumreg) | ![Unit Tests](https://github.com/prjemian/pysumreg/workflows/Unit%20Tests/badge.svg) | [![Coverage Status](https://coveralls.io/repos/github/prjemian/pysumreg/badge.svg?branch=main)](https://coveralls.io/github/prjemian/pysumreg?branch=main) |\n\n- documentation:\n    https://prjemian.github.io/pysumreg/latest\n- source:\n    https://github.com/prjemian/pysumreg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprjemian%2Fpysumreg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprjemian%2Fpysumreg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprjemian%2Fpysumreg/lists"}