You can use numpy broadcasting as follows: d = np.linalg.norm(a[:, None, :] - b[None, :, :], axis=2). Performace should be similar to ...
確定! 回上一頁