
Feb. 20, 2008
11:08 p.m.
Hi Sameer On Wed, Feb 20, 2008 at 03:10:16PM -0600, Sameer DCosta wrote:
Is there a way to rename record array fields without making a copy of the whole record array?
Thanks in advance for your replies.
Simply view the array as a new dtype: In [2]: x Out[2]: array([(1, 2), (3, 4)], dtype=[('a', '<i4'), ('b', '<i4')]) In [3]: x.view([('other',int),('names',int)]) Out[3]: array([(1, 2), (3, 4)], dtype=[('other', '<i4'), ('names', '<i4')]) Regards Stéfan