[NumPy-Tickets] [NumPy] #2064: numpy.digitize uses a linear search when it should be using binary search

NumPy Trac numpy-tickets@scipy....
Sat Feb 25 11:52:23 CST 2012


#2064: numpy.digitize uses a linear search when it should be using binary search
--------------------+-------------------------------------------------------
 Reporter:  jpeel   |       Owner:  somebody   
     Type:  defect  |      Status:  new        
 Priority:  normal  |   Milestone:  Unscheduled
Component:  Other   |     Version:  1.6.1      
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by Sven Marnach):

 The function `searchsorted()` does basically the same thing as
 `digitize()`, but uses a binary search.
 {{{
 numpy.digitize(a, b)
 }}}
 is equivalent to
 {{{
 numpy.searchsorted(b, a, "right")
 }}}
 Maybe `digitize()` should be removed (or wrapped to call
 `searchsorted()`).

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2064#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list