[Numpy-discussion] searchsorted bug

Nadav Horesh nadavh at visionsense.com
Thu Jan 31 09:56:56 EST 2008


It works fine also for me (numpy 1.04 gentoo linux on amd64)

  Nadav
On Thu, 2008-01-31 at 15:51 +0100, lorenzo bolla wrote:
> works fine for me.
>  
> 
> In [33]: A = numpy.array(['a','aa','b'])
> 
> In [34]: B = numpy.array(['d','e'])
> 
> In [35]: A.searchsorted(B)
> Out[35]: array([3, 3])
> 
> In [36]: numpy.__version__
> Out[36]: '1.0.5.dev4567'
> 
> 
>  
> 
> 
> L.
>  
> 
> 
>  
> On 1/31/08, James Philbin <philbinj at gmail.com> wrote: 
> 
>         Hi,
>         
>         The following gives the wrong answer:
>         
>         In [2]: A = array(['a','aa','b'])
>         
>         In [3]: B = array(['d','e'])
>         
>         In [4]: A.searchsorted(B)
>         Out[4]: array([3, 0])
>         
>         The answer should be [3,3]. I've come across this while trying
>         to come
>         up with an ismember function which works for strings
>         (setmember1d
>         doesn't seems to assume numerical arrays).
>         
>         Thanks,
>         James
>         _______________________________________________
>         Numpy-discussion mailing list
>         Numpy-discussion at scipy.org
>         http://projects.scipy.org/mailman/listinfo/numpy-discussion
> 
> 
> 
> 
> -- 
> Lorenzo Bolla
> lbolla at gmail.com
> http://lorenzobolla.emurse.com/ 
> 
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080131/78ddf245/attachment.html>


More information about the NumPy-Discussion mailing list