[reportlab-users] pandas dataframe in a reportlab table

Andy Robinson andy at reportlab.com
Wed Feb 20 17:10:43 EST 2019


I don't use Pandas, but this seems to do it:
>>> df = [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]]
>>> headings = ['Mean','Max','Min','TestA','TestB']
>>> tbl = [headings] + df
>>> tbl[['Mean', 'Max', 'Min', 'TestA', 'TestB'], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]

Hope this helps,

Andy


More information about the reportlab-users mailing list