[Numpy-tickets] [NumPy] #485: Problem with numpy.rec.fromarrays when using 'titles' argument

NumPy numpy-tickets@scipy....
Thu Mar 29 09:33:58 CDT 2007


#485: Problem with numpy.rec.fromarrays when using 'titles' argument
------------------------+---------------------------------------------------
 Reporter:  obi         |       Owner:  somebody                         
     Type:  defect      |      Status:  new                              
 Priority:  normal      |   Milestone:                                   
Component:  numpy.core  |     Version:  1.0.1                            
 Severity:  normal      |    Keywords:  record arrays, fromarrays, titles
------------------------+---------------------------------------------------
 The error is documented by the following ipython log:


 {{{
       1 import numpy
       2 a = numpy.array([1,2,3])
       3 b = numpy.array([0.1,0.2,0.3])
       4 print numpy.rec.fromarrays([a,b],names='A,B')
 ----> 5 print numpy.rec.fromarrays([a,b],names='A,B',titles='Spalte
 1,Spalte 2')

 /usr/lib/python2.4/site-
 packages/numpy-1.0.1-py2.4-linux-i686.egg/numpy/core/records.py in
 fromarrays(arrayList, dtype, shape, formats, names, titles, aligned,
 byteorder)
     317     # Determine shape from data-type.
     318     if len(descr) != len(arrayList):
 --> 319         raise ValueError, "mismatch between the number of fields
 "\
     320               "and the number of arrays"
     321

 ValueError: mismatch between the number of fields and the number of arrays
 WARNING: Failure executing file: <test_fromarrays.py>
 [(1, 0.10000000000000001) (2, 0.20000000000000001) (3,
 0.29999999999999999)]
 }}}

 Note, that the problem does not occur in version 0.9.6.

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/485>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list