Versatile, high-performance histogram toolkit for Numpy.
Project description
histbook computes histograms from Numpy arrays. It differs from most other histogramming tools in that its histograms are primarily tables of numbers, rather than display graphics. Histograms can be filled and refilled iteratively through a large dataset, or in parallel and later combined with addition*. Histograms have arbitrarily many dimensions with convenient methods for selecting, rebinning, and projecting into lower-dimensional spaces.
Axis dimensions are managed by algebraic expressions, rather than string labels or index positions, so they are computable: an axis named x + y requires two Numpy arrays, x and y, which will be added before filling the histogram. Expressions in different axes or different histograms in the same “book” (a collection of named histograms) are computed in an optimized way, reusing subexpressions wherever possible for quicker filling without giving up clarity.
Histogram data may be exported to a variety of formats, such as Pandas, ROOT, and HEPData. It can also be plotted with Vega-Lite, which makes short work of projecting many dimensions of data as overlays and trellises.
(*In this respect, histbook is like histogramming packages developed for particle physics, from CERN HBOOK in the 1970’s (name similarity intended) to modern-day ROOT.)
Installation
Install histbook like any other Python package:
pip install histbook --user
or similar (use sudo, virtualenv, or conda if you wish).
Strict dependencies:
Recommended dependencies:
Pandas for more convenient programmatic access to bin contents
ipyvega to view plots in a Jupyter Notebook
Altair to view plots in Jupyter Notebook or JupyterLab, and to mix histograms with Altair graphics
VegaScope to view plots in a web browser without Jupyter
ROOT to analyze histograms in a complete statistical toolkit
uproot to access ROOT files without the full ROOT framework
Tutorial
See the project homepage for a tutorial.
Interactive tutorial
Run this tutorial on Binder.
Reference documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file histbook-1.0.8.tar.gz
.
File metadata
- Download URL: histbook-1.0.8.tar.gz
- Upload date:
- Size: 647.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd6e2b1ed9f3782d44cb5f6f059ee19994a7073e93384b876ddcfb38698cfb55 |
|
MD5 | 6a4ba23b7a9ae622a1b4ddc8fed4da7b |
|
BLAKE2b-256 | fe8d864e9c83797954fda14ae05765b461e85fb2a17ada57b7cfa2b1d107c1eb |