9/12/09 @ 00:45 (-0500), thus spake josef.p...@gmail.com:
> as long as all numbers are of the same type, you can create a view
> that behaves (mostly) like a regular array
> [...]
Thanks Josef. Great explanation. It's all clear now.
Ernest
___
NumPy-Di
2009/12/8 Ernest Adrogué :
> Hello,
>
> Here's a structured array with fields 'a','b' and 'c':
>
> s=[(i,int) for i in 'abc']
> t=np.zeros(1,s)
>
> It has the form: array([(0, 0, 0)]
>
> I was wondering if such an array can be accessed like an
> ordinary array (e.g., with a slice) in order to set m
Hello,
Here's a structured array with fields 'a','b' and 'c':
s=[(i,int) for i in 'abc']
t=np.zeros(1,s)
It has the form: array([(0, 0, 0)]
I was wondering if such an array can be accessed like an
ordinary array (e.g., with a slice) in order to set multiple
values at once.
t[0] does not access
On Jun 1, 2009, at 4:41 PM, Robert Kern wrote:
> On Mon, Jun 1, 2009 at 17:32, Robert Ferrell
> wrote:
>> Is there a way to get slices of a structured array and keep the field
>> names? For instance, I've got dtype=[('x','f4'),('y','f4'),
>> ('z','f4')] and I want to get just the x & y slices
On Mon, Jun 1, 2009 at 17:32, Robert Ferrell wrote:
> Is there a way to get slices of a structured array and keep the field
> names? For instance, I've got dtype=[('x','f4'),('y','f4'),
> ('z','f4')] and I want to get just the x & y slices into a new array
> with dtype=[('x','f4'),('y','f4')].
>
Is there a way to get slices of a structured array and keep the field
names? For instance, I've got dtype=[('x','f4'),('y','f4'),
('z','f4')] and I want to get just the x & y slices into a new array
with dtype=[('x','f4'),('y','f4')].
I can just make a new dtype, and extract what I need, but