numpy euclidean distance matrix broadcasting code example Example: numpy euclidean distance matrix broadcasting np.sqrt((np.square(a[:,np.newaxis]-b).sum(axis=2)))