If your matrix is not too big, this should do without using other libs. If the matrix is big, this method will be a bit slow and memory intensive.
mx2 = np.random.randint(1,9,5)
nx2 = np.random.randint(1,9,3)
mx2
Out[308]: array([2, 3, 4, 8, 7])
nx2
Out[309]: array([3, 2, 2])
mx2[:,None]-nx2
Out[310]:
array([[-1, 0, 0],
[ 0, 1, 1],
[ 1, 2, 2],
[ 5, 6, 6],
[ 4, 5, 5]])