hypors
Hypothesis testing for Python, backed by the
hypors Rust crate.
Every statistic is computed by the Rust library — these bindings only convert values across the boundary, so Python and Rust always agree.
Install
pip install hypors
Use
from hypors import TailType
from hypors.t import t_test
result = t_test([1.2, 2.3, 1.9, 2.5, 2.8], pop_mean=2.0, tail=TailType.Two, alpha=0.05)
print(result.test_statistic)
print(result.p_value)
print(result.reject_null)
print(result.to_dict())
Any iterable of numbers works — a list, tuple, generator, numpy array,
pandas.Series or polars.Series. The package itself depends on none of
them:
import numpy as np
import polars as pl
t_test(np.array([1.2, 2.3, 1.9]), 2.0, TailType.Two, 0.05)
t_test(pl.Series([1.2, 2.3, 1.9]), 2.0, TailType.Two, 0.05)
Tests available
| Module | Functions |
|---|---|
hypors.t |
t_test, t_test_paired, t_test_ind, t_sample_size |
hypors.z |
z_test, z_test_paired, z_test_ind, z_sample_size |
hypors.proportion |
z_test, z_test_ind, prop_sample_size |
hypors.anova |
anova, f_sample_size |
hypors.chi_square |
independence, goodness_of_fit, variance, chi2_sample_size_gof, chi2_sample_size_ind, chi2_sample_size_variance |
hypors.mann_whitney |
u_test |
hypors.common |
TailType, TestResult |
TailType and TestResult are also importable from the top level.
Results
Every test returns a TestResult with test_statistic, p_value,
confidence_interval, null_hypothesis, alt_hypothesis and reject_null,
plus to_dict() for serialising. Attributes are read-only.
Errors surface as ordinary Python exceptions: ValueError for empty or
insufficient data, RuntimeError for a computation that could not be
completed.
Notes
- The Mann-Whitney U p-value matches
scipy.stats.mannwhitneyuwithmethod="asymptotic". Itstest_statisticismin(U1, U2)while the p-value derives fromU1, so compare p-values rather than statistics when checking against scipy. - Versions track the Rust crate:
hyporson PyPI andhyporson crates.io share a version number.
License
MIT
Metadata
Release files for hypors 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hypors-0.4.1.tar.gz | 40.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| hypors-0.4.1-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| hypors-0.4.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| hypors-0.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| hypors-0.4.1-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| hypors-0.4.1-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 1.6 MB
Release files / hypors-0.4.1.tar.gz
| Download URL | hypors-0.4.1.tar.gz |
|---|---|
| Size | 40.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca09a88a32dc6ef20e2a5bdf4e1a1bcdb4169e10b46dc8ad505fe0094853af6c
|
|
BLAKE2b-256 checksum How to use checksums |
6b77121f654cffe8a55b65457da7e5c8095a5b90e60a2866ec1f9b1f288639e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hypors-0.4.1-cp38-abi3-win_amd64.whl
| Download URL | hypors-0.4.1-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 210.9 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
64fc3a9a2a695502855dc605fcd38aa98b93b98f9c84d383eaef77b779ce27a3
|
|
BLAKE2b-256 checksum How to use checksums |
4f82c416290b5167aa001fe2bbaae2bbaad73a6429c699711a5231ab9546b10e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hypors-0.4.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | hypors-0.4.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 359.1 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
43ffe0f854434df09399f899b83aac2c4a450ed8f1be09c473def33b79c9262f
|
|
BLAKE2b-256 checksum How to use checksums |
da5587458547ab22016fd1aee0a22b2f4fd336f8d3c6c2c06abcd04aa448309c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hypors-0.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | hypors-0.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 351.5 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
fe14b9ecb841c1c74be0beb31648e3eb91a09a0e174218a90dfcda63365454e9
|
|
BLAKE2b-256 checksum How to use checksums |
d014ff2e56e03dd4dc0415a67ea596b9167fc04a7192f3115e8cc0cee3341350
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hypors-0.4.1-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | hypors-0.4.1-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 314.9 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
52f7a5ef36def458a00640618bec53cb306b2c5416cf49caa1abcf52f4724b6a
|
|
BLAKE2b-256 checksum How to use checksums |
cc623bf647fed79bd6e7898cb4b25104dd18f27654cddbc566848b65f684b437
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hypors-0.4.1-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | hypors-0.4.1-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 315.2 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
0eff8d6ee76a36bffd060dc8d7b6bf7227c083daa31149128e5799a840d049b6
|
|
BLAKE2b-256 checksum How to use checksums |
4534ab1f1135fa8b576f2abc60822b0edabd9c84db8f81b6acd0bb1f27ee9393
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|