title: pandas to_csv header vs columns
body: <p>It seems that the pandas.to_csv function has two attributes which does the same thing.</p>
  <p>Maybe I am missing something.</p>
  <p>From the documentation:</p>
  <blockquote>
  <p>columns : sequence, optional</p>
  <p>Columns to write</p>
  <p>header : boolean or list of string, default True</p>
  <p>Write out column names. If a list of string is given it is assumed to be aliases for the column names</p>
  </blockquote>
  <p>When giving either a list of columns, they put the columns into the order I specify.</p>
  <pre><code>import pandas as pd
  from StringIO import StringIO
  
  df = pd.DataFrame({&quot;foo&quot;:[1,2], &quot;bar&quot;:[1,2]})
  
  sio = StringIO()
  df.to_csv(sio)
  sio.getvalue()
  ',bar,foo\n0,1,1\n1,2,2\n'
  
  sio = StringIO()
  df.to_csv(sio, header=['foo', 'bar'])
  sio.getvalue()
  ',foo,bar\n0,1,1\n1,2,2\n'
  sio.close()
  
  sio = StringIO()
  df.to_csv(sio, columns=['foo', 'bar'])
  sio.getvalue()
  ',foo,bar\n0,1,1\n1,2,2\n'
  sio.close()
  </code></pre>
  <p>If I only want to sort the column order, which one is the <em>proper</em> one to use?</p>
  <p>The only scenario I see where it makes sense for these two named attributes to be different is if I want to select columns, but <strong>not</strong> write the header into the csv file.</p>
  <p>This would mean that using <code>columns=['foo', 'bar']</code> is the proper option.</p>