title: Send pandas dataframe data as html e-mail
body: <p>I want to send a pandas dataframe data as an HTML e-mail. Based on <a href="https://stackoverflow.com/questions/18096748/pandas-dataframes-to-html-highlighting-table-rows">this</a> post I could create an html with the dataframe. Code</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  HEADER = '''
  &lt;html&gt;
      &lt;head&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  '''
  FOOTER = '''
      &lt;/body&gt;
  &lt;/html&gt;
  '''
  
  df = pd.DataFrame([[1.1, 1.1, 1.1, 2.6, 2.5, 3.4,2.6,2.6,3.4,3.4,2.6,1.1,1.1,3.3], list('AAABBBBABCBDDD')]).T
  with open('test.html', 'w') as f:
      f.write(HEADER)
      f.write(df.to_html(classes='df'))
      f.write(FOOTER)
  </code></pre>
  
  <p>Now I want to send this as a html e-mail. I tried <a href="https://stackoverflow.com/questions/882712/sending-html-email-using-python">this</a>. Can not figure out how to attach the html file? </p>