I have a question about formatting Excel output: My output looks like: I want the output looks like this: How to add underline and double underline to a row? I am trying to use this: 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. Continue reading...