Skip to main content

The histpy library

The histpy library provides a Histogram class which is, essentially, an array with axes attached defining the bin boundaries. The histpy library class is loosely based on ROOT's histogram but using a more pythonic interface.

Full documentation: https://histpy.readthedocs.io

The histpy library supports:

  • Histograms with an arbitrary number of dimensions.
  • Numpy-like element indexing.
  • Multiple operations: projection, slicing, addition, multiplication, concatenation, rebinning, fitting, interpolation and plotting.
  • Tracking of under and overflow contents along each axes.
  • Weighted histograms.
  • Automatic error propagation.
  • Astropy's units, both for the histogram contents and the axis edges.
  • Spherical coordinates axes, using the HEALPix grid.
  • Sparse contents
  • I/O to/from HDF5 files.

Breaking changes

This section only summarizes non-backward compatible API changes. See CHANGELOG.md for the full list of changes and further details.

Version 2.0.0

  • Histogram no longer tracks under and overflow contents by default. To get the old behavior either set track_overflow = True or initialize the contents with a shape that includes the under and overflow bins.
  • Axis.to() now returns a new Axis object by default, instead of modifying it in place. To get the old behavior, add the argument copy = False.
  • The output format of Axes.interp_weights() has changed. Previously, it returned all bins and weights combinations needed for the interpolation. It now returns interpolation indices and weights for each individual dimension. If the user wishes to recover the points and weights in the old format, this may be done with the following code snippet:
    bins_old = np.asarray(list(itertools.product(*bins_new)))
    weights_old = np.prod(np.array(list(itertools.product(*weights_new))), axis = 1)
    
  • The Axes.__array__() interface has been removed.

Metadata

Release files for histpy 2.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for histpy 2.0.7
File Size Uploaded
histpy-2.0.7.tar.gz 75.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for histpy 2.0.7
File Interpreter ABI Platform
histpy-2.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 131.3 kB

Release files / histpy-2.0.7.tar.gz

Download URL histpy-2.0.7.tar.gz
Size 75.3 kB
Tags Source
SHA-256 checksum
How to use checksums
81a009ce6e295d410e300f440ba3fdcd0fb816c4dbc00c615ea151a6e0ae0094
BLAKE2b-256 checksum
How to use checksums
33a9123824907d883c7a419ef6d41ee5985138eb26d98ffa4d40dbb05440b3bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / histpy-2.0.7-py3-none-any.whl

Download URL histpy-2.0.7-py3-none-any.whl
Size 56.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6030ee3933fa755cc09109cadc7c21dabe25e6a1ba2a5f810c0c6e1014c4918
BLAKE2b-256 checksum
How to use checksums
83bc546c3dbd092e387743db34eec97fbd57358f9c0377e4e1bbb67f128d78b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

2.0.7 This release

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

1 release file

1.1.0

1 release file

1.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page