<jupyter_start><jupyter_text>Sample Excel Exhibit functionalityThis example demonstrates some of the flexibility of the ``Exhibits`` class. Itcreates an Excel file called 'clrd.xlsx' that includes various statistics onindustry development patterns for each line of business in the CAS loss reservedatabase.Output can be viewed online in `Google Sheets `_.See `Exhibits` for more detail.<jupyter_code>import chainladder as cl
import pandas as pd

# Grab industry Paid Triangles
clrd = cl.load_dataset('clrd').groupby('LOB').sum()['CumPaidLoss']

# Create instance of Exhibits
exhibits = cl.Exhibits()

# Line of Business Dictionary for looping
lobs = dict(comauto='Commercial Auto',
            medmal='Medical Malpractice',
            othliab='Other Liability',
            ppauto='Private Passenger Auto',
            prodliab='Product Liability',
            wkcomp='Workers\' Compensation')

# Loop through each LOB
for key, value in lobs.items():
    title = ['CAS Loss Reserve Database',
             value, 'Cumulative Paid Loss',
             'Evaluated as of 31-December-1997']
    # Show Raw Triangle
    exhibits.add_exhibit(key, clrd.loc[key],
                         header=True, formats='money',
                         title=title, col_nums=False,
                         index_label='Accident Year')
    # Show Link Ratios
    exhibits.add_exhibit(key, clrd.loc[key].link_ratio,
                         header=True, formats='decimal',
                         col_nums=False,
                         index_label='Accident Year',
                         start_row=clrd.shape[2]+6)
    # Show various Various Averages
    df = pd.concat(
        (cl.Development(n_periods=2).fit(clrd.loc[key]).ldf_.drop_duplicates(),
         cl.Development(n_periods=3).fit(clrd.loc[key]).ldf_.drop_duplicates(),
         cl.Development(n_periods=7).fit(clrd.loc[key]).ldf_.drop_duplicates(),
         cl.Development().fit(clrd.loc[key]).ldf_.drop_duplicates(),
         cl.Development().fit(clrd.loc[key]).ldf_.drop_duplicates()),
        axis=0)
    df.index = ['2 Yr Wtd', '3 Yr Wtd', '7 Yr Wtd', '10 Yr Wtd', 'Selected']
    exhibits.add_exhibit(key, df, col_nums=False, formats='decimal',
                         index_label='Averages', start_row=clrd.shape[2]*2+7)

# Create Excel File
exhibits.to_excel('clrd.xlsx')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11620016963528414, 'fraction_numerical': 0.008481764206955046, 'mean_word_length': 2.8608837970540097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '173273', 'license': 'MIT', 'n_tokens_mistral': 768, 'n_tokens_neox': 717, 'n_words': 168, 'path': 'docs/auto_examples/plot_exhibits.ipynb', 'repo_name': 'Aborah30/chainladder-python', 'size': '2358'}