[Numpy-discussion] Renaming record array fields (bug)

Sameer DCosta sameerslists@gmail....
Wed Jun 4 14:11:00 CDT 2008


Hi,

There is a bug renaming record array fields if some field names are
the same. I reopened this ticket
http://scipy.org/scipy/numpy/ticket/674 and attached a tiny patch.
Maybe I should have opened a new ticket. Anyway, here is an example
that causes a segfault on the latest svn version.

import numpy as np
dt = np.dtype([('foo', float), ('bar', float)])
a = np.zeros(10, dt)
b = list(a.dtype.names);
b[0] = "notfoo"
#b[1] = "notbar" # uncomment this line for no segfault
a.dtype.names = b
print a, a.dtype # this will crash r5253


Sameer


More information about the Numpy-discussion mailing list