From: Stefan v. d. W. <st...@su...> - 2006-06-30 12:25:22
|
Hi David On Thu, Jun 29, 2006 at 02:42:51PM -0400, David Huard wrote: > Here is something I noticed with digitize() that I guess would qualify = as a > small but annoying bug. >=20 > In [165]: x =3D rand(10); bin =3D linspace(x.min(), x.max(), 10); print= x.min(); > print bin[0]; digitize(x,bin) > 0.0925030184144 > 0.0925030184144 > Out[165]: array([2, 9, 5, 9, 6, 1, 1, 1, 4, 5]) >=20 > In [166]: x =3D rand(10); bin =3D linspace(x.min(), x.max(), 10); print= x.min(); > print bin[0]; digitize(x,bin) > 0.0209738428066 > 0.0209738428066 > Out[166]: array([ 5, 2, 8, 3, 0, 8, 9, 6, 10, 9]) Good catch! Fixed in SVN (along with docstring and test). Cheers St=E9fan |