title: Pandas DataFrame to Excel: Vertical Alignment of Index
body: <p>Given the following data frame:
  import pandas as pd</p>
  
  <pre><code>d=pd.DataFrame({'a':['a','a','b','b'],
                 'b':['a','b','c','d'],
                 'c':[1,2,3,4]})
  d=d.groupby(['a','b']).sum()
  d
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0RPtg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0RPtg.png" alt="enter image description here"></a></p>
  
  <p>I'd like to export this with the same alignment with respect to the index (see how the left-most column is centered vertically?).
  The rub is that when exporting this to Excel, the left column is aligned to the top of each cell:</p>
  
  <pre><code>writer = pd.ExcelWriter('pandas_out.xlsx', engine='xlsxwriter')
  workbook  = writer.book
  f=workbook.add_format({'align': 'vcenter'})
  d.to_excel(writer, sheet_name='Sheet1')
  writer.save()
  </code></pre>
  
  <p>...produces...</p>
  
  <p><a href="https://i.stack.imgur.com/5lUQB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5lUQB.png" alt="enter image description here"></a></p>
  
  <p>Is there any way to center column A vertically via XLSX Writer or another library?</p>
  
  <p>Thanks in advance!</p>