[Numpy-discussion] Efficiently defining a multidimensional array

Jonathan T terhorst@gmail....
Thu Aug 27 16:09:40 CDT 2009


I want to define a 3-D array as the sum of two 2-D arrays as follows:

   C[x,y,z] := A[x,y] + B[x,z]

My linear algebra is a bit rusty; is there a good way to do this that does not
require me to loop over x,y,z? Thanks!


More information about the NumPy-Discussion mailing list