title: When saving a pandas dataframe to csv how do I retain the columns.name?
body: <h2>Initial Problem</h2>
  <p>When I run the following in ipython</p>
  <pre><code>import numpy as np
  import pandas as pd
  
  df = pd.DataFrame(np.round(9*np.random.rand(4,4), decimals=1))
  df.index.name = 'x'
  df.columns.name = 'y'
  
  df.to_csv('output.csv')
  
  df
  </code></pre>
  <p>it outputs the following result:</p>
  <pre><code>y    0    1    2    3
  x                    
  0  7.6  7.4  0.3  7.5
  1  5.6  0.0  1.5  5.9
  2  7.1  2.1  0.0  0.9
  3  3.7  6.6  3.3  8.4
  </code></pre>
  <p>However when I open <code>output.csv</code> the &quot;y&quot; is removed:</p>
  <pre><code>x   0   1   2   3
  0   7.6 7.4 0.3 7.5
  1   5.6 0   1.5 5.9
  2   7.1 2.1 0   0.9
  3   3.7 6.6 3.3 8.4
  </code></pre>
  <p>How do I make it so that the <code>df.columns.name</code> is retained when I output the dataframe to csv?</p>
  <h2>Crude workaround</h2>
  <p>Current crude work-around is me doing the following:</p>
  <pre><code>df.to_csv('output.csv', index_label = 'x|y')
  </code></pre>
  <p>Which results in <code>output.csv</code> reading:</p>
  <pre><code>x|y 0   1   2   3
  0   7.6 7.4 0.3 7.5
  1   5.6 0   1.5 5.9
  2   7.1 2.1 0   0.9
  3   3.7 6.6 3.3 8.4
  </code></pre>
  <p>Something better would be great! Thanks for your help (in advance).</p>
  <h2>Context</h2>
  <p>This is what I am working on: <a href="https://github.com/SimonBiggs/Electron-Cutout-Factors" rel="nofollow noreferrer">https://github.com/SimonBiggs/Electron-Cutout-Factors</a></p>
  <p>This is an example table: <a href="https://github.com/SimonBiggs/Electron-Cutout-Factors/blob/master/output/20140807_173714/06app06eng/interpolation-table.csv" rel="nofollow noreferrer">https://github.com/SimonBiggs/Electron-Cutout-Factors/blob/master/output/20140807_173714/06app06eng/interpolation-table.csv</a></p>