Skip to main content

Histogram data in bins but there are 2**64 (almost un-bound) bins.

Project description

TestStatus PyPiStatus BlackStyle BlackPackStyle MITLicenseBadge

This UnBoundhHistogram has bins with a fixed width. But if needed, it offers an almost un-bound amount of 2**64 bins. Making a histogram in an almost un bound range is usefule when one does not know the range of the data in advance and when streaming thrhough the data is costly. UnBoundhHistogram was created to histogram vast streams of data generated in costly simulations for particle physics. Buzz word bingo: big data.

Install

pip install un_bound_histogram

Usage

import un_bound_histogram
import numpy

prng = numpy.random.Generator(numpy.random.PCG64(1337))

h = un_bound_histogram.UnBoundHistogram(bin_width=0.1)

h.assign(x=prng.normal(loc=5.0, scale=2.0, size=1000000))

# assign multiple times to grow the histogram.
h.assign(x=prng.normal(loc=-3.0, scale=1.0, size=1000000))
h.assign(x=prng.normal(loc=1.0, scale=0.5, size=1000000))

assert 0.9 < h.percentile(50) < 1.1
assert h.sum() == 3 * 1000000

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

un_bound_histogram-0.0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

un_bound_histogram-0.0.1-py3-none-any.whl (3.9 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