Hi Peter,
this is also the behavior of the numpy histogram function. I personally
don't like it, but I think it's kept for compatibility's sake with Numeric.
You could use
def histogram(a, bins):
n = sort(a).searchsorted(bins)
n = concatenate([n, [len(a)]])
count = concatenate([[n[0]],
Hello,
thanks for the quick reply to my last problem.
Here I've got a new one:
While the last bin carries the overshoot, the first bin does not carry the
undershoot.
Example:
from numpy import *
from pylab import *
bins = 2 + arange(21)
data = arange(24)
print bins
print data
hist(data,bins)