[Scipy-tickets] [SciPy] #1268: lexsort doesn't work with datetime.date objects

SciPy Trac scipy-tickets@scipy....
Fri Aug 20 07:36:12 CDT 2010


#1268: lexsort doesn't work with datetime.date objects
-------------------------+--------------------------------------------------
 Reporter:  ernest_ac    |       Owner:  somebody
     Type:  enhancement  |      Status:  new     
 Priority:  normal       |   Milestone:  0.9.0   
Component:  Other        |     Version:  0.7.0   
 Keywords:               |  
-------------------------+--------------------------------------------------
 lexsort() fails when it gets an array of datetime.date objects, because
 mergesort does not support this particular data type.

 Example:

 {{{
 > In [86]: date = np.array([datetime.date(2000, 9, 17),
 >  datetime.date(2000, 10, 1),
 >  datetime.date(2000, 10, 22),
 >  datetime.date(2000, 11, 1)])
 >
 > In [90]: date
 > Out[90]: array([2000-09-17, 2000-10-01, 2000-10-22, 2000-11-01],
 > dtype=object)
 >
 > In [91]: np.lexsort((date,))
 >
 ---------------------------------------------------------------------------
 > TypeError                                 Traceback (most recent call
 last)
 > TypeError: merge sort not available for item 0

 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1268>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list