[NumPy-Tickets] [NumPy] #1908: Incorrect parsing of dtype comma separated strings that have datatime64 (was: incorrect parsing of datetime64 strings in 1.6.1rc3)

NumPy Trac numpy-tickets@scipy....
Sat Jul 16 13:12:23 CDT 2011


#1908: Incorrect parsing of dtype comma separated strings that have datatime64
------------------------+---------------------------------------------------
 Reporter:  rocha       |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  numpy.core  |     Version:  devel      
 Keywords:  datetime    |  
------------------------+---------------------------------------------------

Comment(by rocha):

 The error comes from the way dtype parses the comma separated strings. It
 stops parsing the string if datetime64 is found, and if it is not the
 first element, it incorrectly parses the frequency.

 Example:

 {{{
 >>> numpy.dtype('datetime64[s]')
 dtype('datetime64[s])
 >>> numpy.dtype('i, datetime64[s]')
 dtype([('f0', '<i4'), ('f1', ('<M8[us]', {}))])
 >>> numpy.dtype('datetime64[s], i')
 dtype('datetime64[s]')
 >>> numpy.dtype('i, datetime64[s], i, i')
 dtype([('f0', '<i4'), ('f1', ('<M8[us]', {})), ('f2', '<i4'), ('f3',
 '<i4')])
 }}}

 Python 2.6.6 numpy 1.6.1rc3

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


More information about the NumPy-Tickets mailing list