Home > Back-end >  How can I bold just one column in my dataframe so I can export to an excel?
How can I bold just one column in my dataframe so I can export to an excel?

Time:05-21

I have been reading documentation and some questions here, but I only found solutions with conditions, I have some columns in my dataframe that I want to bold and then concatenate.

My dataframe it´s like this:

Name Product
Paul Produc1
Jhon product2

I want all the values in my column(Paul, Jhon) to be bold so I can export that to an excel.

CodePudding user response:

Using Series.str.upper

df.Name = df.Name.str.upper()

CodePudding user response:

Let's try

df.style.applymap(lambda x: 'font-weight: bold;', subset='Name')\
        .to_excel('output.xlsx')
  • Related