[Numpy-discussion] adding field to rec array

John Hunter jdh2358 at gmail.com
Wed Sep 26 13:40:29 EDT 2007


I have a record array r and I want to add a new field to it.  I have
been looking at setfield but I am not sure how to use it for this
purpose.  Eg

# r is some npy record array
N = len(r)
x = npy.zeros(N)
# add array of floats x to r with dtype name 'jdh' and type '<f8'

Any suggestions?

JDH



More information about the NumPy-Discussion mailing list