python numpy euclidean distance calculation between matrices of row vectors December 11, 2023 by Tarik To get the distance you can use the norm method of the linalg module in numpy: np.linalg.norm(x - y)