def abs_distance(temp_vals):
    """Takes a list of numbers and returns the idex of the number in the list
    that has the smallest distance to 20.

    Args:
        temp_vals ([temp_vals]): List of numbers

    Returns:
        [Int]: Index of the number in the list that is closest to 20

    Note:
        If multiple numbers in the list have the same distance to 20. The first 
        value that is reached during iteration is kept.
    """
    smallest_dist = float('inf')
    index_of_smallest = -1
    for i in range(0, len(temp_vals)):
        val = temp_vals[i]
        try:
            value = float(val)
        except:
            value = float(val[:-3])
        if abs(value - 20) < smallest_dist:
            smallest_dist = abs(value - 20)
            index_of_smallest = i
    return index_of_smallest