3D array -> 2D array issue...
7 Feb
2011
7 Feb
'11
12:21 p.m.
Hi all, Let's say C1 is a 3D array, and q0 and k are 2D array. dim C1 = nx*ny*nz dim q0 = nx*ny = dim k I have to do the following: q0[0, 0] = C1[0, 0, k[0, 0]] q0[1, 1] = C1[1, 1, k[1, 1]] ... q0[i, j] = C1[i, j, k[i, j]] ... I tried q0 = C1[:, :, k] but this obviously does not work. How could I do this ala NumPy? TIA Cheers, -- Fred
4578
Age (days ago)
4789
Last active (days ago)
11 comments
5 participants
participants (5)
-
Fred
-
Gael Varoquaux
-
josef.pktdï¼ gmail.com
-
Olivier Grisel
-
Ralf Gommers