def to_float(i):
    """Convert to a float."""
    if isinstance(i, list):
        return [to_float(j) for j in i]
    if isinstance(i, tuple):
        return tuple(to_float(j) for j in i)

    return float(i)