Skip to main content

Online stats in python, based in generators with send

Project description

Code style: black Checked with mypy Tests Status

Generators Based Online Statistics

This package implement online statistics written using python generators, with the only depencency of numpy.

It can callculate basic stats in an online manner with good stability.

install

poetry add onstats

pip install onstats

How to use:

Import the window / rolling statistic you want to compute and send the values to it:

>>>  from onstats import ma # moving average

>>>  gma = ma(2)  # with window 2
>>>  gma.send(3)
3

>>>  gma.send(5)
4
>>>  gma.send(5)
5

If w = 0 the window is infinitelly large , we will compute the normal average.

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

onstats-0.9.2.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

onstats-0.9.2-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

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