Skip to main content

Computes (batch-wise) sample statistics.

Project description

pyBatchedMoments

pypi-version python-version Build, Test & Deploy to PyPI

pyBatchedMoments is a Python library for computing (batch-wise) sample statistics, such as mean, variance, standard deviation, skewness and kurtosis.

In certain applications it is needed to compute simple statistics of a population, but with textbook formulae the calculation can suffer from loss of precision and can be numerically unstable. Additionally, for large populations only a single pass over the values is feasible, therefore, an incremental (batch-wise) approach is desirable.

Install

To install the current release

pip install batchedmoments

Example

from batchedmoments import BatchedMoments

data = [2, 8, 0, 4, 1, 9, 9, 0]
bm = BatchedMoments()
bm(data)

# use computed values
bm.mean
bm.std

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

batchedmoments-0.1.2.tar.gz (6.3 kB view hashes)

Uploaded Source

Supported by

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