0

I have a question about formatting Python output:

my output looks like:

enter image description here

I want the output looks like this:

enter image description here

How to add underline and double underline to a dataframe? Thanks a lot.

I am trying to use this: enter image description here

But does not work...

I also tried:

writer = pd.ExcelWriter(r"C:\Users\2222222222.xlsx")

workbook = writer.book
cell_format = workbook.add_format()
cell_format.set_underline()

fat_age_all.to_excel(writer, 'by Age',index = False, startrow=3, startcol=0)

worksheet.set_row(5, cell_format)

writer.save()

It does not work too. Please help thanks a lot.

Jean Hu
  • 115
  • 8

0 Answers0