Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove bold formatting on Dataframe index

I have a dataframe as below, with date as Index

Date           Count
01/01/2020       10
02/01/2020       14
03/01/2020        7

When writing the dataframe to excel, the index is always in bold. how do I remove the bold formatting on the index?

like image 811
Arlowest Avatar asked Jul 10 '26 22:07

Arlowest


1 Answers

You can use trick - convert index to column and then not write index to file like:

df.reset_index().to_excel(file, index=False)
like image 169
jezrael Avatar answered Jul 13 '26 19:07

jezrael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!