On 9/26/07, Robert Kern [EMAIL PROTECTED] wrote:
Here is the straightforward way:
In [15]: import numpy as np
In [16]: dt = np.dtype([('foo', int), ('bar', float)])
In [17]: r = np.zeros((3,3), dtype=dt)
Here is a (hopefully) simple question. If I create an array like
this, how can I
John Hunter wrote:
On 9/26/07, Robert Kern [EMAIL PROTECTED] wrote:
Here is the straightforward way:
In [15]: import numpy as np
In [16]: dt = np.dtype([('foo', int), ('bar', float)])
In [17]: r = np.zeros((3,3), dtype=dt)
Here is a (hopefully) simple question. If I create an array
John Hunter wrote:
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'