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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.238s · 89.5MB
glibcpy 3.10–3.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.
histogram1d
✓ from fast_histogram import histogram1d
✗ from fasthistogram import histogram1d
Module name uses underscore, not hyphen
histogram2d
✓ from fast_histogram import histogram2d
✗ from fast_histogram import histogram2d
Correct import path
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)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'fast_histogram'
Trying to import from 'fast_histogram' but installed package is 'fast-histogram'.
fixInstall correctly: pip install fast-histogram. Then import: from fast_histogram import histogram1d
ValueError: The 'range' argument is required
range not provided or set to None.
fixAlways provide a range tuple, e.g., histogram1d(data, bins=50, range=(-3, 3))
Upgrade
Version history
0.14latest on PyPI · released Apr 16, 2024
Audit
Dependencies
numpyrequiredCore dependency for array operations