import numpy as np
M,N,R = 2,3,4
# For a 3-dimensional array A:
A = np.reshape(np.r_[0:M*N*R], [M,N,R], order = 'C')
# and 2-dimensional array B:
B = np.reshape(np.r_[0:M*R], [R,M], order = 'C')
I would like the N*M
matrix that results from multiplying slice i
of A
by column i
of B
. I have tried np.dot
, and np.einsum
and have been unable to obtain what I need.
Could anybody help, please? Thanks!