Hi, <br><br>Here is something I noticed with digitize() that I guess would qualify as a small but annoying bug. <br><br>In [165]: x = rand(10); bin = linspace(x.min(), x.max(), 10); print x.min(); print bin[0]; digitize(x,bin)
<br>0.0925030184144<br>0.0925030184144<br>Out[165]: array([2, 9, 5, 9, 6, 1, 1, 1, 4, 5])<br><br>In [166]: x = rand(10); bin = linspace(x.min(), x.max(), 10); print x.min(); print bin[0]; digitize(x,bin)<br>0.0209738428066
<br>0.0209738428066<br>Out[166]: array([ 5,  2,  8,  3,  0,  8,  9,  6, 10,  9])<br><br>Sometimes, the smallest number in x is counted in the first bin, and sometimes, it is counted as an outlier (bin number = 0). Moreover, creating the bin with 
<br>bin = linspace(x.min()-eps, x.max(), 10) doesn't seem to solve the problem if eps is too small (ie 1./2**32). So basically, you can have<br><br>In [186]: x.min()>bin[0]<br>Out[186]: True<br>and yet digitize() considers 
x.min() as an outlier.<br><br>And to actually do something constructive, here is a docstring for digitize<br>"""Given an array of values and bin edges, digitize(values, bin_edges) returns the index of the bin each value fall into. 
<br><br>The first bin has index 1, and the last bin has the index n, where n is the number of bins. <br>Values smaller than the inferior edge are assigned index 0, while values larger than the superior edge are assigned index n+1.
<br>"""<br><br>Cheers, <br><br>David<br>P.S. Many mails I send don't make it to the list. Is it gmail related ? <br>