示例#1
0
def test_simple_exhibit():
    raa = cl.load_dataset('raa')

    col = cl.Column(cl.DataFrame(raa, margin=(0, 0, 1, 0)),
                    cl.DataFrame(raa.link_ratio, formats={'italic': True}))
    composite = cl.Row(col,
                       col,
                       title=['This title spans both Column Objects'],
                       margin=(0, 1, 0, 0))
    x = cl.Tabs(('a_sheet', composite),
                ('another_sheet', composite)).to_excel('workbook.xlsx')
def test_simple_exhibit():
    raa = cl.load_sample("raa")

    col = cl.Column(
        cl.DataFrame(raa, margin=(0, 0, 1, 0)),
        cl.DataFrame(raa.link_ratio, formats={"italic": True}),
    )
    composite = cl.Row(
        col, col, title=["This title spans both Column Objects"], margin=(0, 1, 0, 0)
    )
    x = cl.Tabs(("a_sheet", composite), ("another_sheet", composite)).to_excel(
        "workbook.xlsx"
    )
示例#3
0
    # Excel exhibit
    sheets.append((
        lob,
        # Layout individual sheet vertically (i.e. Column)
        cl.Column(
            cl.Title([
                'CAS Loss Reserve Database', lob, 'Cumulative Paid Loss',
                'Evaluated as of December 31, 1997'
            ]),
            cl.DataFrame(clrd.loc[lob_abb],
                         index_label='Accident Year',
                         formats={
                             'num_format': '#,#',
                             'align': 'center'
                         }), cl.CSpacer(),
            cl.DataFrame(clrd.loc[lob_abb].link_ratio,
                         index_label='Accident Year',
                         formats={
                             'num_format': '0.000',
                             'align': 'center'
                         }), cl.CSpacer(),
            cl.DataFrame(ldfs,
                         index_label='Averages',
                         formats={
                             'num_format': '0.000',
                             'align': 'center'
                         }))))

# Output to excel
cl.Tabs(*sheets).to_excel('clrd.xlsx')