Generation

generate functionTue, 18 Apr 2023

insert convert dataframe, add new page and save to pdf.

import pandas as pd from tabulate import tabulate def convertToPDF(Path, df): html = tabulate(df, headers=df.columns, tablefmt='html', showindex=False) pdf = '<html><head></head><body>' + html + '</body></html>' with open(Path + ".pdf", 'w') as f: f.write(pdf)

Want to kickstart your project?Use the new AI Studio to create your code