Skip to main content

A lightweight statistics helper library for learning

Project description

mystats-helper

A lightweight, pure-Python statistics helper library built for learning.

Installation

pip install mystats-helper-adamdockstader

In futurecoder / Pyodide

import micropip
await micropip.install("mystats-helper-adamdockstader")

Quick Start

import mystats_helper

data = [4, 8, 15, 16, 23, 42]

# Descriptive statistics
print(mystats_helper.mean(data))       # 18.0
print(mystats_helper.median(data))     # 15.5
print(mystats_helper.stdev(data))      # 13.28...
print(mystats_helper.describe(data))   # full summary dict

# Z-scores
print(mystats_helper.z_scores(data))

# Correlation & regression
x = [1, 2, 3, 4, 5]
y = [2, 4, 5, 4, 5]
print(mystats_helper.correlation(x, y))
slope, intercept = mystats_helper.linear_regression(x, y)
print(f"y = {slope:.2f}x + {intercept:.2f}")

Available Functions

Function Description
mean(data) Arithmetic mean
median(data) Median
mode(data) Mode (most frequent value)
variance(data, population=False) Sample or population variance
stdev(data, population=False) Standard deviation
z_score(x, mu, sigma) Single z-score
z_scores(data) Z-scores for all values
percentile(data, p) p-th percentile (0–100)
iqr(data) Interquartile range
correlation(x, y) Pearson's r
linear_regression(x, y) Returns (slope, intercept)
describe(data) Summary dict (count, mean, stdev, min, Q1, median, Q3, max)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mystats_helper_adamdockstader-0.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file mystats_helper_adamdockstader-0.0.1.tar.gz.

File metadata

File hashes

Hashes for mystats_helper_adamdockstader-0.0.1.tar.gz
Algorithm Hash digest
SHA256 108d6d09987f704d1166736a13bb768fc7ab3b93c72cd953706e32a45b30c99b
MD5 1cc856500c272184e0420e9efddf1428
BLAKE2b-256 6fe401f97f25f48b7ac426d66d681d1016419f125d2f08999d4f0c2b7d4e790c

See more details on using hashes here.

File details

Details for the file mystats_helper_adamdockstader-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mystats_helper_adamdockstader-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 adf82472ccbdbcde7668b8d48911c60c3cc7a300d4caa3affb62bbd88df9e42b
MD5 0c20fad00fb45696deabf1eeef555989
BLAKE2b-256 8eec2be8da2c78b08476bc448bf46352f5be189f519277a891560a42e17f551a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page