Pragmastat: Pragmatic Statistical Toolkit
Project description
Pragmastat
This is a Python implementation of 'Pragmastat: Pragmatic Statistical Toolkit', which presents a toolkit of statistical procedures that provide reliable results across diverse real-world distributions, with ready-to-use implementations and detailed explanations.
- PDF manual for this version: https://pragmastat.dev/pragmastat-v3.1.16.pdf
- Online manual for the latest version: https://pragmastat.dev
- Manual DOI: 10.5281/zenodo.17236778
- Source code: https://github.com/AndreyAkinshin/pragmastat/tree/v3.1.16/python
Installation
pip install pragmastat
Demo
from pragmastat import center, spread, rel_spread, shift, ratio, avg_spread, disparity
def main():
x = [0, 2, 4, 6, 8]
print(center(x)) # 4
print(center([v + 10 for v in x])) # 14
print(center([v * 3 for v in x])) # 12
print(spread(x)) # 4
print(spread([v + 10 for v in x])) # 4
print(spread([v * 2 for v in x])) # 8
print(rel_spread(x)) # 1
print(rel_spread([v * 5 for v in x])) # 1
y = [10, 12, 14, 16, 18]
print(shift(x, y)) # -10
print(shift(x, x)) # 0
print(shift([v + 7 for v in x], [v + 3 for v in y])) # -6
print(shift([v * 2 for v in x], [v * 2 for v in y])) # -20
print(shift(y, x)) # 10
x = [1, 2, 4, 8, 16]
y = [2, 4, 8, 16, 32]
print(ratio(x, y)) # 0.5
print(ratio(x, x)) # 1
print(ratio([v * 2 for v in x], [v * 5 for v in y])) # 0.2
x = [0, 3, 6, 9, 12]
y = [0, 2, 4, 6, 8]
print(spread(x)) # 6
print(spread(y)) # 4
print(avg_spread(x, y)) # 5
print(avg_spread(x, x)) # 6
print(avg_spread([v * 2 for v in x], [v * 3 for v in x])) # 15
print(avg_spread(y, x)) # 5
print(avg_spread([v * 2 for v in x], [v * 2 for v in y])) # 10
print(shift(x, y)) # 2
print(avg_spread(x, y)) # 5
print(disparity(x, y)) # 0.4
print(disparity([v + 5 for v in x], [v + 5 for v in y])) # 0.4
print(disparity([v * 2 for v in x], [v * 2 for v in y])) # 0.4
print(disparity(y, x)) # -0.4
if __name__ == "__main__":
main()
The MIT License
Copyright (c) 2025 Andrey Akinshin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pragmastat-3.1.16.tar.gz.
File metadata
- Download URL: pragmastat-3.1.16.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40f946e2a879ce0032b14a4c45ffc603e1a518efaa698fd42c581f7e1d74ab39
|
|
| MD5 |
6c0d3b1ce038469afe59dd6f152a0955
|
|
| BLAKE2b-256 |
1b270c9e7c17b864a4c0ed71a7a201bb0dabbe554a11c42f3aed8548bb44e7fb
|
Provenance
The following attestation bundles were made for pragmastat-3.1.16.tar.gz:
Publisher:
publish.yml on AndreyAkinshin/pragmastat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pragmastat-3.1.16.tar.gz -
Subject digest:
40f946e2a879ce0032b14a4c45ffc603e1a518efaa698fd42c581f7e1d74ab39 - Sigstore transparency entry: 583401695
- Sigstore integration time:
-
Permalink:
AndreyAkinshin/pragmastat@40ede71983e72634dcde0ed6003d7d6311292125 -
Branch / Tag:
refs/tags/v3.1.16 - Owner: https://github.com/AndreyAkinshin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40ede71983e72634dcde0ed6003d7d6311292125 -
Trigger Event:
push
-
Statement type: