def profit_filler(df, max_length):
    """Takes a dataframe and ensures all the profit rows are the same length for
    adding together profits over the number of games, shorter rows will be
    filled with their final value.
    example: row 0 = [1,2,3,4], row 1 = [1,2,3] -> row 0 = [1,2,3,4],
    row 1 = [1,2,3,3]

    Parameters:
    df (pandas.core.frame.DataFrame): data frame containing the simulation
    results
    max_length (int): The longest set of results in the simulation

    Returns:
    pandas.core.frame.DataFrame: The simulation results converted to be used
    for calculating profit. All runs being the same length with the shorter
    rows maintaining its final value.
    """
    spin = [i for i in range(1, max_length + 1)]
    data = df
    for i in range(len(data['profit'])):
        size = max_length - len(data['profit'][i])
        data['profit'][i].extend([data['profit'][i][-1]]*size)
        data['spin'][i] = spin

    return data