Euclidean-Distance

Sat 17 May 2025

title: "Euclidean Distance" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


def euclidean_distance(p, q):

    #make sure both array are in the same dimension
    assert len(p) == len(q)  

    return max([abs(x-y) for x,y in zip(p,q)])
acb = euclidean_distance([1,2,3],[1, 2, 3])
print(acb)
0


Score: 0

Category: basics