I have been trying to find a way to add dataframe in a pdf file using pdfpages. But I did not find any opt solution yet. My dataframe has around 5k rows and 10 columns. How do i append it to pdf?
The code I have written gives a very blurry and small df. Like very very small and even if you zoom in, you can only see blurry stuff. Any optimal way to add df to pdf using pdfpages?
my code:
df1 = data[data['olddate'].dt.date == data['newdate'].dt.date]
table = pd.DataFrame(df1)
fig = plt.figure(figsize=(12, 12))
ax = fig.add_subplot(111)
cell_text = []
for row in range(len(table)):
cell_text.append(table.iloc[row])
ax.table(cellText=cell_text, colLabels=table.columns, loc='center')
ax.axis('off')
export_pdf.savefig(fig)
plt.close()