Euclidean Distance

    0

    1

    HARIGOVIND VALSAKUMAR

    PythonEuclidean
    HGV Public Cookbook

    Function to find the euclidean distance between two coordinate points.

    import math
    
    def euclidean_distance(x, y):
        distance = 0
        for i,j in zip(x, y):
            distance += (i - j) ** 2
        return math.sqrt(distance)
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.