[NumPy-Tickets] [NumPy] #674: Impossible to rename object fields

NumPy Trac numpy-tickets@scipy....
Fri Feb 25 15:47:15 CST 2011


#674: Impossible to rename object fields
------------------------+---------------------------------------------------
  Reporter:  sameer     |       Owner:  somebody
      Type:  defect     |      Status:  reopened
  Priority:  normal     |   Milestone:          
 Component:  numpy.lib  |     Version:  1.5.1   
Resolution:             |    Keywords:          
------------------------+---------------------------------------------------
Changes (by aickley):

  * status:  closed => reopened
 * cc: ilya.kolpakov@… (added)
  * component:  numpy.core => numpy.lib
  * version:  none => 1.5.1
  * milestone:  1.1.0 =>
  * resolution:  fixed =>


Comment:

 I get this bug with fresh numpy 1.5.2

 {{{
 In [20]: numpy.__version__
 Out[20]: '1.5.1'

 In [21]: olddt = dtype([('foo', '|O4'), ('bar', float)])

 In [22]: a = zeros(10, olddt)

 In [23]: newdt = dtype([('notfoo', '|O4'), ('notbar', float)])

 In [24]: b = a.view(newdt)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/kolpakov/work/code/futdata.py in <module>()
 ----> 1
       2
       3
       4
       5

 TypeError: Cannot change data-type for object array.
 > <ipython console>(1)<module>()
 }}}

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


More information about the NumPy-Tickets mailing list