worksheet = writer.sheets['test']
header = workbook.add_format({'bold': True})
index = workbook.add_format({'align': 'left'})
worksheet.set_row(0, None, header)
worksheet.set_column(0, 0, None, index)
Apply styles while exporting to 'xlsx' in pandas with XlsxWriter