I have a Dataframe with a long text content and I wish to save it as a table (in .PNG) with some formatting. Can you please suggest the packages and technique? I'm a newbie to python
CodePudding user response:
try dataframe_image
https://pypi.org/project/dataframe-image/
pip install dataframe_image
Import the packages
import pandas as pd
import numpy as np
import dataframe_image as dfi
df = pd.DataFrame(np.random.randn(6, 6), columns=list('UVWXYZ'))
Add some gradient
df_styled = df.style.background_gradient()
dfi.export(df_styled,"dataframe.png")