title: Xlsxwriter - Trouble formatting pandas dataframe cells using xlsxwriter
body: <p>I have an excel sheet which came from a pandas dataframe. I then use Xlsxwriter to add formulas, new columns and formatting. The problem is I only seem to be able format what I've written using xlsxwriter and nothing that came from the dataframe. So what I get is something like this <a href="http://i.stack.imgur.com/hqa0e.png" rel="nofollow">half formatted table</a> </p>
  
  <p>As you can see from the image the two columns from the dataframe remain untouched. They must have some kind of default formatting that is overriding mine.</p>
  
  <p>Since I don't know how to convert a worksheet back into to a dataframe the code below is obviously completely wrong but it's just to give an idea of what I'm looking for.</p>
  
  <pre><code>export = "files/sharepointExtract.xlsx"
  df = pd.read_excel(export)# df = dataframe
  
  writer = pd.ExcelWriter('files/new_report-%s.xlsx' % (date.today()), engine = 'xlsxwriter')
  workbook = writer.book
  
  # Code to make the header red, this works fine because 
  # it's written in xlsxwriter using write.row()
  
  colour_format = workbook.add_format()
  colour_format.set_bg_color('#640000')
  colour_format.set_font_color('white')
  worksheet.set_row(0, 15, colour_format)
  
  table_body_format = workbook.add_format()
  table_body_format.set_bg_color('blue')
  
  for row in worksheet.rows:
    row.set_row(0,15, table_body_format)
  </code></pre>
  
  <p>This code gives an Attribute error but even without the for loop we just get what can be seen in the image.</p>