Skip to main content

Composable and blazing fast rolling-quantile filters for streaming data and bulk batches.

Project description

Rolling Quantiles for NumPy

Hyper-efficient and composable filters.

  • Simple, clean, intuitive interface.
  • Supports streaming data or bulk processing.
  • Python 3 bindings for a compact library written in pure C.

A Quick Tour

import numpy as np
import rolling_quantiles as rq

pipe = rq.Pipeline( # rq.Pipeline is the only stateful object
  # declare a cascade of filters by a sequence of immutable description objects
  rq.LowPass(window=200, portion=100, subsample_rate=2),
    # the above takes a median (100 out of 200) of the most recent 200 points
    # and then spits out every other one
  rq.HighPass(window=10, portion=3,  subsample_rate=1))
    # that subsampled rolling median is then fed into this filter that takes a
    # 30% quantile on a window of size 10, and subtracts it from its raw input

# the pipeline exposes a set of read-only attributes that describe it
pipe.lag # = 60.0, the effective number of time units that the real-time output
         #   is delayed from the input
pipe.stride # = 2, how many inputs it takes to produce an output
            #  (>1 due to subsampling)


input = np.random.randn(1000)
output = pipe.feed(input) # the core, singular exposed method

# every other output will be a NaN to demarcate unready values
subsampled_output = output[1::pipe.stride]

See the Github repository for more details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

rolling_quantiles-1.1.0-cp39-cp39-win_amd64.whl (17.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

rolling_quantiles-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (52.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

rolling_quantiles-1.1.0-cp39-cp39-macosx_10_15_x86_64.whl (17.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

rolling_quantiles-1.1.0-cp38-cp38-win_amd64.whl (17.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rolling_quantiles-1.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (52.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

rolling_quantiles-1.1.0-cp38-cp38-macosx_10_15_x86_64.whl (17.2 kB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

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