Purpose

There are more than enough histogramming packages for python out in the wild, and some have a lot of functionality beyond dropping data into bins.

  • This package is just for dropping data into bins, but as fast as possible (on a CPU), while also keeping a simple code base.
  • A property of histograms lacking from other options is the ability to retrieve the sum of weights squared in each bin (it’s possible in NumPy, but not directly from the histogramming functions).
  • Finally, I thought it would be fun to learn how to write software with OpenMP and pybind11 because I had not used either before.

Some of the other options:

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