Subtract Rows of Matrix from rows of another matrix numpy I have two matrix V_r of shape(19, 300) and vecs of shape(100000, 300). I would like to subtract rows of V_r from from rows of vecs. Currently, I am achieving this with the following code. Is there a way to do it using broadcasting?

    list=[]
for v in V_r:
    a=np.linalg.norm(vecs-v,axis=1)
    list.append(a)
M=np.vstack(list)
This is what you're looking for :  np.linalg.norm(vecs-V_r[:,np.newaxis], axis = 2)