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
Try
r = r.view(numpy.recarray)
barry
On 10/5/07, John Hunter <[EMAIL PROTECTED]> 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]:
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 c
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 typ
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 'http://projects.scipy.org/mailma