--- id: boost-histogram version: "1.8.0" license: BSD-3-Clause AND BSL-1.0 license_treatment: permissive maintenance: active --- # boost-histogram — The Boost::Histogram Python wrapper. License: permissive · Maintenance: active · Downloads: 968.0K/mo ## What it is and what it does boost-histogram is a Python wrapper around Boost::Histogram, a high-performance C++ histogram library. It lets you create and manipulate histograms with flexible axis types (regular, variable-width, categorical, boolean), multiple storage backends (double, integer, weighted, mean), and advanced indexing following the UHI (Universal Histogram Indexing) protocol. The package is designed for scientific computing and data analysis workflows where speed and expressiveness matter. You compose histograms by specifying axes and storage types, fill them with data (including weighted or sample data), and query results via NumPy array views or specialized accessors. It supports slicing, projection, rebinning, and arithmetic operations on histograms. The library integrates with the broader scikit-HEP ecosystem, including Hist (an analyst-friendly wrapper), mplhep (plotting), and dask-histogram (distributed computing). Use it for: - Build multidimensional histograms for physics or astronomy data analysis with fast filling and slicing. - Accumulate weighted or mean-valued samples using specialized storage types for statistical analysis. - Create histograms with custom axis transforms (log, sqrt, power) for non-linear binning schemes. - Project and rebin histograms on the fly to explore data along different dimensions. - Integrate histogram operations into Dask workflows for distributed data processing. - Plot histograms via UHI-compatible libraries like mplhep without manual conversion. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. boost-histogram provides Python bindings to Boost::Histogram, a C++14 library for fast histogram creation and manipulation with support for multiple axis types, storage modes, and advanced indexing. Yes. boost-histogram is actively maintained, permissively licensed, widely available as pre-built wheels, and has no known vulnerabilities. It is a solid choice if you need fast, flexible histogramming for scientific or data analysis work. Install friction is moderate due to C++ compilation, but wheels mitigate this for common platforms and Python versions. ## Install pip install boost-histogram uv add boost-histogram poetry add boost-histogram ## Installing boost-histogram Before you install: Medium install friction due to compiled C++ extensions; pre-built wheels available for Python 3.10–3.15 across macOS (x86_64 and ARM64), Linux (x86_64 and aarch64), Windows, and musl-based systems. Active maintenance with a release 7 days ago. License in practice: Dual-licensed under BSD-3-Clause and BSL-1.0 (permissive); both allow commercial and private use with minimal restrictions, making it safe for most projects. Quickstart: import boost_histogram as bh import numpy as np hist = bh.Histogram(bh.axis.Regular(10, 0, 1)) hist.fill([0.1, 0.5, 0.9]) values = hist.values() Requires Python ≥3.10; numpy is a runtime dependency. Verify before relying: - Performance comparison claims ('one of the fastest libraries') lack quantitative benchmarks in the fact sheet. - Thread-safety guarantees for AtomicInt64 storage and growing axes under concurrent load are not detailed. ## Package facts - License: BSD-3-Clause AND BSL-1.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 968.0K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fast histogram library python, boost histogram bindings, multidimensional histograms, histogram with named axes, scientific data binning, histogram storage types, weighted histogram accumulation, histogram-binning, scientific-computing, data-analysis [View on SkillFed](https://skillfed.io/packages/boost-histogram) · [View on PyPI](https://pypi.org/project/boost-histogram/)