title: How can I format the index column(s) with xlsxwriter?
body: <p>I'm using <strong>xlsxwriter</strong> and the <strong>set_column</strong> function that format the columns in my excel outputs. </p>
  
  <p>However, formatting seems to be ignored when applied to the index column (or index columns in case of multi index). </p>
  
  <p>I've found a workaround, so far is to introduce a fake index with <strong>reset_index</strong> then pass <strong>index=False</strong> to the to_excel function but then the nice merging feature of the multi index will be gone too.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  from Config import TEMP_XL_FILE
  
  def temp():
      ' temp'
      pdf = pd.DataFrame(np.random.randn(6,4), columns=list('ABCD'))
      pdf.set_index('A', drop=True, inplace=True)
      writer = pd.ExcelWriter(TEMP_XL_FILE, engine='xlsxwriter')
      pdf.to_excel(writer, 'temp')
      workbook = writer.book
      worksheet = writer.sheets['temp']
      tempformat = workbook.add_format({'num_format': '0%', 'align': 'center'})
      worksheet.set_column(-1, 3, None, tempformat)
      writer.save()
  
  if __name__ == '__main__':
      temp()
  </code></pre>