[Numpy-discussion] Array of Arrays

Alexander Michael lxander.m at gmail.com
Fri Mar 23 09:33:23 EDT 2007


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



More information about the NumPy-Discussion mailing list