I have two np.arrays, say A=np.array([1,2,3]) and B=np.array([1,2,3,4]) for example. I want to compute a new array C such that the first row of C is the first element of A minus every element in B, the second row of C is the second element of A minus every element in B and the last row of C is the third element of A minus every element in B. Is it possible to code it without using any for loop or numpy repeat? I know that we can use bsxfun in matlab. I search but I cannot obtain satisfactory answer.