Registry / data / distogram

distogram

JSON →
library3.0.3pypypi✓ verified 85d ago

A library to compute histograms on distributed environments, on streaming data. Current version: 3.0.3. Released occasionally, with breaking changes from v2 to v3 (API redesign).

pip install distogram
INSTALL
IMPORT
SIG · DISTOGRAM
D
distogram
datapythonv3.0.3
Install
3.1s avg
Import
12ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.1s · import 0.010s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Distogram
from distogram import Distogram
from distogram import distogram
In distogram v3, the class is named Distogram (capital D). v2 used a lowercase distogram function.
insert
from distogram import insert
distogram.insert(dist, value)
The module-level insert function is now importable directly.
histogram
from distogram import histogram
distogram.histogram(dist, bins=10)
The histogram function is now separate; in v2 it was method on distogram object.

Create a Distogram, insert data points, then retrieve histogram bins.

from distogram import Distogram, insert, histogram dist = Distogram() for v in [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]: insert(dist, v) bins = histogram(dist, bins=3) print(bins)
Debug
Known issues
breakingdistogram v3 changes the API from a function-based interface to a class-based one. The old distogram() function is replaced by the Distogram class. Functions like insert, histogram, merge are now module-level functions taking a Distogram object as first argument.
fix
Replace distogram() with Distogram(), and use module-level functions: from distogram import Distogram, insert, histogram.
affects: >=3.0.0
breakingdistogram v3 removes the bin_count parameter from Distogram constructor. Use max_bins instead.
fix
Change Distogram(bin_count=50) to Distogram(max_bins=50).
affects: >=3.0.0
deprecatedThe old distogram module function (lowercase) is removed in v3. Trying to import it will raise ImportError.
fix
Use from distogram import Distogram (capital D).
affects: 3.0.0
gotchadistogram does not preserve precise quantiles; it's an approximation. Do not rely on exact percentile values.
fix
Use for approximate histograms only; for exact quantiles use other tools.
affects: *
Errors
Common errors & fixes
AttributeError: module 'distogram' has no attribute 'distogram'
Trying to use the old v2 API (distogram.distogram) on v3.
fix
Use from distogram import Distogram and then Distogram().
TypeError: distogram() takes 1 positional argument but 2 were given
Calling Distogram(bin_count=50) which is v2 syntax. v3 uses max_bins.
fix
Use Distogram(max_bins=50).
ImportError: cannot import name 'Distogram' from 'distogram'
Installed distogram v2.x which does not have the class. Or typo.
fix
Upgrade to distogram>=3.0.0 with pip install --upgrade distogram.
Upgrade
Version history
3.0.3latest on PyPI · released Mar 10, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
distogram — pip install distogram · libregistry