def max_length(df):
    """Helper function for profit_filler, interates through the results of spins
    and returns the longest set of spins.

    Parameters:
    df (pandas.core.frame.DataFrame): data frame containing the simulation
    results

    Returns:
    int: The maximum length of the spin counts

    """
    row_lengths = list(map(lambda x: len(x), df['spin']))
    return max(row_lengths)