title: How can I write a csv file with multiple header lines with pandas to_csv()?
body: <p>Consider a data frame with a <code>date</code> column as an index and three columns <code>x</code>, <code>y</code> and <code>z</code> with some observations. I want to write the contents of this data frame to a .csv file. I know I can use <code>df.to_csv</code> for this, however, I would like to add a second header line with the units. In this example, the desired .csv file would look something like this:</p>
  
  <pre><code>date,x,y,z  
  (yyyy-mm-dd),(s),(m),(kg)  
  2014-03-12,1,2,3  
  2014-03-13,4,5,6  
  ...
  </code></pre>