pygram11 status Documentation Status PyPI version

Simple and fast histogramming in python via pybind11 and (optionally) OpenMP

Your mileage may vary with OpenMP. The unit tests which are run by continuous integration do not test the OpenMP features (but I do run these tests locally).


pygram11 requires only NumPy and pybind11.

From PyPI

$ pip install pygram11

From Source

$ git clone
$ cd pygram11
$ pip install .

Feature Support

pygram11 plans to provide fast functions for generating histograms and their statistical uncertainties. Fixed and variable width binned histograms in multiple dimensions will be supported.

Histogram type Available API stable
1D, fixed bins Yes No
1D, varying bins Yes No
2D, fixed bins Yes No
2D, varying bins Yes No


  • numpy.histogram: versatile but slow; doesn’t handle statistical uncertainty.
  • fast-histogram: leverages NumPy’s C API. Very fast (fixed bin only) histogramming and easy to install; no OpenMP support or statistical uncertainty.
  • physt: way more than just sorting data into bins.