Tom Denniston wrote:
> So searchsorted is supposed to take a list.  The arguments I am using
> are not correct. 

No, it will take a scalar value to search for, too.

In [18]: numpy.searchsorted(numpy.array([1, 2, 3, 4]), 1)
Out[18]: 0

In [19]: numpy.searchsorted(numpy.array(['1', '2', '3', '4']), '1')
Out[19]: 0

> But it still seems strange to me that these
> incorrect params trigger a memory error.  Is a check simply missing or
> is this possibly a sign of a larger bug?  I can simply correct my
> params so this is no big deal, but I just wanted to report it as it
> seemed like a subtle bug.

It is a bug, but the source is probably the array of strings, not fact that the
 search value is a scalar.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to