This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!
Project Description


Matplotlib histograms are geared around drawing, not data manipulation. Numpy direct support for histograms is extremely limited, and not very different from matpotlib. This is intended to turn into a set of very lightweight classes for shuffling data around. This is very much a work-in-progress.

The only required depenency is numpy, and the package is designed to work for python >= 2.6


A summary of usage, taken from the docstring follows:

>>> from simplehist import Hist
Initialise with bin indices:
>>> a = Hist([0, 1, 2, 3])
>>> a.bincount
>>> a.bins
(0, 1, 2, 3)
array([ 0.,  0.,  0.])
Optionally include data:
>>> a = Hist([0, 1, 2, 3], data=[1, 0.2, 3])
array([ 1. ,  0.2,  3. ])
Or just specify the blank data type:
>>> a = Hist([0, 1, 2, 3], dtype=int)
array([0, 0, 0])
You can do arithmetic operations in place or seperately:
>>> a = Hist([0, 1, 2, 3], data=[1, 0.2, 3])
>>> b = a + a
>>> b -= a
>>> ==
array([ True,  True,  True], dtype=bool)
And you can fill bins from values:
>>> a = Hist([0,1,2,3])
>>> a.fill(1.4, weight=3)
array([ 0.,  3.,  0.])
Even out of range:
>>> a = Hist([0,1])
>>> a.fill(-10)
>>> a.underflow
If you use pyROOT, you can convert from 1D histograms:
>>> type(source)
<class 'ROOT.TH1D'>
>>> convert = fromTH1(source)
>>> type(convert)
<class 'simplehist.hists.Hist'>

And you can draw histograms, using any of the options that can be passed to matplotlib.pyplot.hist:

>>> hist_object.draw_hist(lw=2)
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
SimpleHist-0.1.tar.gz (9.8 kB) Copy SHA256 Checksum SHA256 Source Jan 16, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting