[Numpy-discussion] [numpy-discussion] searchsorted bug
James Philbin
philbinj@gmail....
Thu Jan 31 08:53:20 CST 2008
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
More information about the Numpy-discussion
mailing list