A histogram object written in Python for scientific data-reduction and statistical analysis
The primary object of this module is a continuous-domain histogram. Any number of dimensions is supported though only the lower dimensions can be visualized. For more information, see the following documentation:
This package is dependent on NumPy and SciPy, provides methods for producing and showing graphics through Matplotlib and can be serialized via python's pickling, NumPy's binary format or HDF5.
For collecting statistics on discrete keys or catagories you may want to look into the collections.Counter class.
In this module, the histogram is elevated to its own object, effectively merging the array and associated edges returned by the numpy.histogramdd()
method. Creating, filling and displaying a histogram should be as simple as this example:
import numpy as np
from matplotlib import pyplot
from histogram import Histogram, plothist
np.random.seed(1)
h = Histogram(100,[0,10])
h.fill(np.random.normal(5,1,10000))
plothist(h)
pyplot.show()
While there is no lack of other histogramming libraries out there, most have a narrow focus or seem to be quickly put together, lacking documentation, or are part of a much larger analysis framework. The goal of this project is to be a solution for all python developers who want just a bit more functionality than that provided by NumPy's histogramdd()
method.
This project took many cues from the following python packages, trying to merge the features of each one into a single object:
- histogram
- pyhistogram
- histogramy
- pypeaks
- SimpleHist
- hist
- hierogram
- histo
- python-metrics
- statscounter
- multihist
- vaex
- datagram
- hdrhistogram
- dashi
- physt
- matplotlib-hep
Furthermore, the author was greatly influenced by the histogram classes found in CERN's ROOT data analysis framework.