def RepairMissingData(time_series, first_value):
    """Given a list of time series value in a string format, replace missing
    values.  If the first time point is missing, set it to first_value. This
    should be 1 if the log transform will be taken or 0 otherwise. If later
    time points are missing, set them to the previous observed time point.
    """
    if time_series[0] == '':
        time_series[0] = first_value

    for i in range(1, len(time_series)):
        if time_series[i] == '':
            time_series[i] = time_series[i-1]

    return time_series