[Numpy-discussion] Array of Arrays

Nadav Horesh nadavh at visionsense.com
Fri Mar 23 10:20:51 EDT 2007


How about

 a = empty((5,7,4))
 c = a[...,-1]
.
.
.
  Nadav
-----Original Message-----
From:	numpy-discussion-bounces at 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 at scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion



-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2727 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070323/42a27940/attachment.bin>


More information about the NumPy-Discussion mailing list