[Numpy-discussion] Array of Arrays
Nadav Horesh
nadavh@visionsense....
Fri Mar 23 09:20:51 CDT 2007
How about
a = empty((5,7,4))
c = a[...,-1]
.
.
.
Nadav
-----Original Message-----
From: numpy-discussion-bounces@scipy.org on behalf of Alexander Michael
Sent: Fri 23-Mar-07 15:33
To: Discussion of Numerical Python
Cc:
Subject: [Numpy-discussion] Array of Arrays
How can I do something like the following?
a = empty((5,7), dtype=<4 element array of floats>)
c = a[:,-1] # last column of 4 element arrays
a[0,0] = 2.0
print a[0,0]
[2. 2. 2. 2.]
a[1,0] = 3.0
a[0,1] = a[0,0] * a[1,0]
print a[0,1]
[6. 6. 6. 6.]
etc.
As always, thanks for the help!
Alex
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 2727 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070323/42a27940/attachment-0001.bin
More information about the Numpy-discussion
mailing list