lose/utils/algorithms/distances.py
def manhattan_distance(x, y):
    """Calculates the distance between x and y using the manhattan
    formula.

    This seems slower than euclidean and it is the least accurate

    Args:
        x (point): a point in space
        y (point): a point in space

    Returns:
        int:  the distance calculated between point x and point y
    """
    diffs = [abs((xval or 0) - (yval or 0)) for xval, yval in lzip(x, y)]
    return sum(diffs)
Calculates the distance between x and y using the manhattan
    formula.

    This seems slower than euclidean and it is the least accurate

    Args:
        x (point): a point in space
        y (point): a point in space

    Returns:
        int:  the distance calculated between point x and point y
    
Calculates the distance between x and y using the manhattan
formula.

This seems slower than euclidean and it is the least accurate
Calculates the distance between x and y using the manhattan formula . This seems slower than euclidean and it is the least accurate
def manhattan_distance(x, y):
    diffs = [abs((xval or 0) - (yval or 0)) for xval, yval in lzip(x, y)]
    return sum(diffs)
def manhattan_distance ( x , y ) : diffs = [ abs ( ( xval or 0 ) - ( yval or 0 ) ) for xval , yval in lzip ( x , y ) ] return sum ( diffs )
Calculates the distance between x and y using the manhattan
formula.
Calculates the distance between x and y using the manhattan formula .
"""Calculates the distance between x and y using the manhattan
    formula.

    This seems slower than euclidean and it is the least accurate

    Args:
        x (point): a point in space
        y (point): a point in space

    Returns:
        int:  the distance calculated between point x and point y
    """
the distance calculated between point x and point y
the distance calculated between point x and point y
int
x
a point in space
a point in space
y
a point in space
a point in space