numpy: find the euclidean distance between two 3-d arrays,np.sqrt(((A - B) ** 2).sum(-1))