[Numpy-discussion] Histograms of extremely large data sets  eric
jones eric at enthought.com Thu Dec 14 13:25:20 CST 2006  Rick
White wrote: > Just so we don't get too smug about the speed, if
I do this in IDL on   > the same machine it is 10 times faster
(0.28 seconds instead of 4   > seconds).  I'm sure the IDL
version uses the much faster approach of   > just sweeping
through the array once, incrementing counts in the   >
appropriate bins.  It only handles equal-sized bins, so it is
not as   > general as the numpy version -- but equal-sized bins
is a very common   > case.  I'd still like to see a C version of
histogram (which I guess   > would need to be a ufunc) go into
the core numpy. Yes, this gets rid of the search, and indices
can just be caluclated  from offsets.  I've attached a modified
weaved histogram that takes this  approach.  Running the snippet
below on my machine takes .118 sec for  the evenly binned weave
algorithm and 0.385 sec for Rick's algorithm on  5 million
elements.  That is close to