fast-histogram
Fast 1D and 2D histogram functions in Python
Fast 1D and 2D histogram functions in Python
To install this package, run one of the following:
Sometimes you just want to compute simple 1D or 2D histograms with regular bins. Fast. No nonsense. Numpy’s histogram functions are versatile, and can handle for example non-regular binning, but this versatility comes at the expense of performance.
The fast-histogram mini-package aims to provide simple and fast histogram functions for regular bins that don’t compromise on performance. It doesn’t do anything complicated - it just implements a simple histogram algorithm in C and keeps it simple. The aim is to have functions that are fast but also robust and reliable. The result is a 1D histogram function here that is 7-15x faster than numpy.histogram, and a 2D histogram function that is 20-25x faster than numpy.histogram2d.
Summary
Fast 1D and 2D histogram functions in Python
Last Updated
May 15, 2025 at 07:26
License
BSD-2-Clause
Total Downloads
18.1K
Supported Platforms
Unsupported Platforms
GitHub Repository
https://github.com/astrofrog/fast-histogram