[Numpy-discussion] dtype field renaming

Pierre GM pgmdevlist@gmail....
Wed Apr 8 17:12:08 CDT 2009


On Apr 8, 2009, at 5:57 PM, Elaine Angelino wrote:

> hi there --
>
> for a numpy.recarray, is it possible to rename the fields in the  
> dtype?

Take a new view:
 >>> a = np.array([(1,1)],dtype=[('a',int),('b',int)])
 >>> b = a.view([("A",int), ('b', int)])

or:

use numpy.lib.recfunctions.rename_fields


More information about the Numpy-discussion mailing list