def preprocess_baseline2(segment_df, rush_hour):
    """
    Preprocess the segment data considering the weather and the rush hour

    Algorithm:
    Preprocess segment_df to add a new column of rush hour
    split the dataframe with groupby(segment_start, segment_end, weather, rush_hour)
    Define the new dataframe
    For name, item in grouped:
        calcualte the average travel duration
        save the record into the new dataframe

    :param segment_df: dataframe after adding the rush hour from final_segment.csv file
    :param rush_hour: tuple to express which is the rush hour, example: ('17:00:00', '20:00:00')
    :return: dataframe for the baseline2
    """
    # Preprocess segment_df to add a new column of rush hour
    rush_hour_column = segment_df['timestamp'].apply(lambda x: x[11:19] < rush_hour[1] and x[11:19] > rush_hour[0])
    new_segment_df = segment_df
    new_segment_df['rush_hour'] = rush_hour_column
    grouped = new_segment_df.groupby(['segment_start', 'segment_end', 'weather', 'rush_hour'])
    result = grouped['travel_duration'].mean()
    result = result.reset_index()
    return result