def get_start_end_time()

in functions/source/preprocess/preprocess.py [0:0]


def get_start_end_time(dataframe):
    """
    Creating middle_time, start_time, end_time columns for creation
    of Infection Time Window plots, for each collection date.
    ----------
    fieldname : dataframe
        Pandas dataframe
    Returns
    --------
    dataframe_

        temp dataframe for ploting total timelines

    """

    for i in dataframe.index:

        dataframe.loc[i, 'middle_time'] = dataframe.loc[
            i, 'collection_dt_tm']

        dataframe.loc[i, 'start_time'] = dataframe.loc[
            i, 'collection_dt_tm'] - timedelta(days=3)

        dataframe.loc[i, 'end_time'] = dataframe.loc[
            i, 'collection_dt_tm'] + timedelta(days=3)
    return dataframe