[Numpy-discussion] Array of Arrays

Alexander Michael lxander.m@gmail....
Fri Mar 23 08:33:23 CDT 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