Function to find midpoint of two floats where one of the floats might be an empty string
def get_new_position(prev_seq, next_seq):

    if next_seq == "":
        new_position = float(prev_seq) + 1
    elif prev_seq == "":
        new_position = float(next_seq) - 1
    else:
        new_position = (float(prev_seq) + float(next_seq)) / 2

    return new_position