def render_xlsx(cls):
'''
Render the df to a xlsx file.
'''
# load data
df = sample_names_data()
# build presentation model
pm = tc.build_presentation_model(df=df, output_format='xlsx')
# render to xlsx
tempdir = tempfile.gettempdir()
fp = os.path.join(tempdir, 'example1.xlsx')
layout = [pm]
print('Writing to ' + fp)
xlsxw.XLSXWriter.to_xlsx(layout, output_fp=fp)
# end_XLSXExample1
# start_XLSXExample2
评论列表
文章目录