I am trying to format the excel sheet with the borders with python pandas, but no luck, can anyone please assist.
I have data like this:
I want this in this format:
It is not straightforward, You have to iterate through the dataframe and add the format to each cell.
cell_format = workbook.add_format()
cell_format.set_border()
for col_num, col in enumerate(df.columns.values):
for row_num, value in enumerate(df[col].values):
worksheet.write(row_num + 1, col_num + 1, value, cell_format)