Save a pandas dataframe as table in Image or pdf document with nice multi index display
问题 I'm trying to include a data frame with multi-index in a report in pdf. I would like to have a nice table output. I have found these 2 solutions: pandas.df -> HTML -> pdf import pandas as pd from IPython.display import HTML import pdfkit # df generation df = pd.read_csv(path_to_csv, sep =',') groupeddf = df.groupby('Cluster') res = groupeddf.describe([0.05, 0.5, 0.95]) res.index.rename(['Cluster', 'stats'], inplace=True) res['Cluster'] = res.index.get_level_values('Cluster') res['stats'] =