def create_seconds_elapsed(row):
    """
    this function parses the string time column and converts it into game
    seconds elapsed

    Inputs:
    row - row of play by play dataframe

    Outputs:
    time_in_seconds - the elapsed game time expressed in seconds
    """
    time_list = row['pctimestring'].strip().split(':')
    max_time = 720
    ot_max_time = 300
    if row['period'] in [1, 2, 3, 4]:
        time_in_seconds = max_time - (int(time_list[0]) * 60 + int(
            time_list[1])) + 720 * (int(row['period']) - 1)
    elif row['period'] > 4:
        time_in_seconds = ot_max_time - (int(time_list[0]) * 60 + int(
            time_list[1])) + 300 * (int(row['period']) - 5) + 2880
    return time_in_seconds
