Table Of Contents

Previous topic

Histogram: User’s Guide

Next topic


This Page


The histogram python package provides a simple yet fundamental data structure for scientific computing: histogram. A histogram object is a container of axes, data, and error bars. With this package, you can create histograms, take slices of them, and perform numerical operations.

Here is an example of a python session:

from histogram import histogram, axis, arange, plot
xaxis = axis('x', arange(5), unit='meter')
yaxis = axis('y', arange(7), unit='cm')
axes = [xaxis, yaxis]
h = histogram( "intensity", axes, fromfunction=lambda x,y: x**2+y**2)
print h
plot(h)   # need matplotlib
slice = h[3, ()]
from histogram.hdf import dump  # need h5py
dump(slice, 'slice.h5')

More information

This package is a product of the DANSE project, which is supported by the US National Science Foundation under grant DMR-0520547.