Registry / data / fast-histogram

fast-histogram

JSON →
library0.14pypypi✓ verified 34d ago

Fast simple 1D and 2D histograms for Python, using C extensions. Current version: 0.14, released 2024-08-12. Cadence: irregular.

dataai-ml
Install & Compatibility
Where this runs
tested against v0.14 · 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.238s · 89.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.5s · import 0.262s · 86MB
89MB installed
● package 89MB
Code
Verified usage

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

Module name uses underscore, not hyphen

from fast_histogram import histogram1d

Correct import path

from fast_histogram import histogram2d

Compute a 1D histogram with 50 bins over range [-3, 3].

import numpy as np from fast_histogram import histogram1d data = np.random.randn(1000) bins = 50 range_vals = (-3, 3) h = histogram1d(data, bins=bins, range=range_vals) print(h.shape)
Debug
Known footguns
breakingv0.13 dropped support for Python <=3.8 and requires numpy >= 1.20, v0.14 requires Python >=3.9 and numpy >= 1.22 to support numpy 2.0.
gotchaThe range argument must be provided explicitly; it defaults to None which raises an error.
deprecatedThe numpy.histogram and numpy.histogram2d are slower; this library is intended as a drop-in replacement but weights behavior differs slightly.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
23 hits · last 30 days
gptbot
4
ahrefsbot
4
bytedance
4
amazonbot
3
claudebot
3
script
1
Resources