Skip to main content

Online statistics for Numpy arrays.

Project description

numpy-onlinestats

PyPI pre-commit.ci status unit tests Documentation Status

This is a Python package for element-wise streaming statistics of Numpy arrays, meaning that arrays can be added one-by-one. This is much more memory-efficient than first collecting all arrays before calculating statstics. One major usecase is Bayesian modeling, where the posterior distribution is often intractable and can only be approximated via sampling. This concerns both MCMC and variational inference meethods. MCMC is inherently sampling-based, while variational inference methods can have derived quantities or structured posteriors that do not admit closed-form expressions for properties of their distribution.

numpy-onlinestats approximates quantiles and cumulative distribution functions using the t-digest algorithm (in particular, it uses this implementation) and calculates exact moments using a numerically stable algorithm.

Requirements

  • Python 3.10 or newer
  • A C++20 compatible compiler with OpenMP support (developed with GCC 13 using -std=c++20)
  • libopenmp

Sample code

import numpy as np
import numpy_onlinestats as npo

stats = npo.NpOnlineStats(np.random.uniform(size=(5, 3, 7)))
for i in range(100):
    stats.add(np.random.uniform(size=(5, 3, 7)))

stats.quantile(0.25)
stats.mean()
stats.var()

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

numpy_onlinestats-0.1.1.tar.gz (663.0 kB view details)

Uploaded Source

Built Distributions

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

numpy_onlinestats-0.1.1-cp313-cp313-win_amd64.whl (593.1 kB view details)

Uploaded CPython 3.13Windows x86-64

numpy_onlinestats-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (231.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

numpy_onlinestats-0.1.1-cp313-cp313-macosx_15_0_arm64.whl (381.1 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

numpy_onlinestats-0.1.1-cp313-cp313-macosx_14_0_arm64.whl (381.4 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

numpy_onlinestats-0.1.1-cp312-cp312-win_amd64.whl (593.1 kB view details)

Uploaded CPython 3.12Windows x86-64

numpy_onlinestats-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (231.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

numpy_onlinestats-0.1.1-cp312-cp312-macosx_15_0_arm64.whl (381.1 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

numpy_onlinestats-0.1.1-cp312-cp312-macosx_14_0_arm64.whl (381.4 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

numpy_onlinestats-0.1.1-cp311-cp311-win_amd64.whl (595.0 kB view details)

Uploaded CPython 3.11Windows x86-64

numpy_onlinestats-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

numpy_onlinestats-0.1.1-cp311-cp311-macosx_15_0_arm64.whl (383.5 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

numpy_onlinestats-0.1.1-cp311-cp311-macosx_14_0_arm64.whl (383.9 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

numpy_onlinestats-0.1.1-cp310-cp310-win_amd64.whl (595.2 kB view details)

Uploaded CPython 3.10Windows x86-64

numpy_onlinestats-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

numpy_onlinestats-0.1.1-cp310-cp310-macosx_15_0_arm64.whl (383.7 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

numpy_onlinestats-0.1.1-cp310-cp310-macosx_14_0_arm64.whl (384.1 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file numpy_onlinestats-0.1.1.tar.gz.

File metadata

  • Download URL: numpy_onlinestats-0.1.1.tar.gz
  • Upload date:
  • Size: 663.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for numpy_onlinestats-0.1.1.tar.gz
Algorithm Hash digest
SHA256 716caf212fadd2cd42ad7bb8a24246e36f45238a2b0754a58c858ef649b9ea9f
MD5 2b3c8495c15d5c38294e17e91f8611d2
BLAKE2b-256 0e91529eca7bda1c07c15b8a1c6e5fe1cbc6abb09cb517ba77d2bb6e13c78223

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1.tar.gz:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 45ad15b886ce8403eb00cf557a0e5faba73b0e78896d6fb62bbbb4d47dcdba7d
MD5 781c1c59bb58709d16bc47f84dcf1146
BLAKE2b-256 fd7415870634b2e9f9b9be6f0ae7a3b00354004cd56e35ca5aaaf909ad16e654

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp313-cp313-win_amd64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09709cc3d3020017b4cd713efcf5fd1275bc3b4320f962d9eb3ffc32b308d19e
MD5 c09d31d6b05d0f98a4cf7b6f52304185
BLAKE2b-256 a432792b48828e7f2249061617d247498691eb0433524fc6533a3ef03727a065

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 07326e52a7c82e42b7db773edf5803c2e6361b9926981371f73d5eb35c8876e6
MD5 70fee1212af421e36fce87e5ffab5440
BLAKE2b-256 ae30788edb677f0b31b97b31171aef0346b1a06b52cc488f281fd7f36ac2ab68

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 780aea8919e2b6d66c6db0219e212aed86cc34c6ec6e0830571aaec74c7bc079
MD5 102d109f164c050b9e32d46b9d7258a7
BLAKE2b-256 7943c2da356a91e75dcabd4645cfcc9e8927ca7f7cbf5d9da7646a0560362e47

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b8b83a8df54cb61e31415a267317cf5e99f1ad5113791af2329a5e1c8380cedf
MD5 cc0454530a0df9872b0d487b867285bd
BLAKE2b-256 93dc1ce12ca69431f3b67445011d2793861dfbd5dc2a3e6575aa18a4e350eff0

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ecd38799f231070c95245fdfc0daf4f80ee4ac3456def13e4de747336d5a991a
MD5 328fac587ef194cde299c849513e5ce8
BLAKE2b-256 82e89612195d444c434e4c1b58658025117eae6b44c71b14bcc39fecafca565c

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 03aea3c1cc4820fa8ae65fdf9f6d7ad00b56bbee6284a8d6563e05b75a84c057
MD5 79b17b78563dee85c1d909a53c7d0585
BLAKE2b-256 1033ecac6b33c9de9dcbf243120e84c70c08948858f9df241ef2de2828de4978

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0d694a094423ace42825bde2fd44ba6b4d4e7c8878533303720f9b3660b6a820
MD5 0f6cab67e44bad59e50cd59797a9aec5
BLAKE2b-256 a3cbcf1cb785146425b56fc61530c2fa367e1d63ba5b3032a3c029ff0cb81301

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a1a79bc031a079d904016f06de6e674baabbbc7c8d7ad9dcb9aff0354b421f92
MD5 b8fff1edec6d764a3ddeba62511371c6
BLAKE2b-256 fa97cbad6c7a43c84d75413488fbafc4744bfde65b1c464c4737d5947e9670e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp311-cp311-win_amd64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a8def227d419de28c4297ec314fef048f8fa8c0ffc6f6f79f3f2f11b6cb3fab
MD5 3227f18cad31e9f422223e80dda6406d
BLAKE2b-256 b3ccc448da628e9dcf5ec4cae7f857e1d697270a52f60c759585751a4e90047b

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 90f00ad894252455320e31fde8d4d6e23ee432c5c286cfb380012d69cbf878e1
MD5 fef9a41965a4c52b48403df5d246ed2a
BLAKE2b-256 f819bc4aae4fd5fc5c617ba6cb8da3ddbbd499614e9b373d503d655996c4a592

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 cc706c8118381dd301202894de88743d203ff5cea1626a0a0403acef956321f2
MD5 3089acb84e48dd1f9a1e83514a95b785
BLAKE2b-256 a61d3bbc70b95acf4f24b1070504b041baa6b38aec931319eb4421560b65e075

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 797bac9cc04073f26e27b89a09c05c777e38deb51020d59dd4a8bdbbeabda953
MD5 f2ddc11ceca2c4e922836884be8ed3c4
BLAKE2b-256 cd1cff0c690108a8f16a506fe3f2d49edc1702a942219f314ced4041795005a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp310-cp310-win_amd64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fbd419252132aea1f135a287e111c06922d1fb62fa82271b640aaea1e509d91
MD5 679d042a67eff25aa41e098d86deb19f
BLAKE2b-256 3865d0cf1d23125e136d4f46aea8a736b1c13831528d1e86236af26143f34f58

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 832c81f8f6ef13b823d3194b7d1fc176d6eaf25ea3a10fce27751ac9a9fa4b3a
MD5 d9eb4a43af481d6544834e3132fbee2f
BLAKE2b-256 c52ff6670d60ecb646d5a3dd4c12533204337c297698ae2463d3296128d6698a

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp310-cp310-macosx_15_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpy_onlinestats-0.1.1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for numpy_onlinestats-0.1.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d220a925c233703977b77d78e3490c40095f93a91dd5ee937cd943b43cf505da
MD5 71919522c0f4e940e0a130805139e346
BLAKE2b-256 8c3c715ce30488caf71837ebe03a48ef59a42511ebc0d3ac4aa45f767e985ae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpy_onlinestats-0.1.1-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: release.yaml on ilia-kats/numpy-onlinestats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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