title: Preserving column order in Python Pandas DataFrame
body: <p>Is there a way to preserve the order of the columns in a csv file when read and the write with Python Pandas? For example, in this code</p>
  
  <pre><code>import pandas as pd
  
  data = pd.read_csv(filename)
  data.to_csv(filename)
  </code></pre>
  
  <p>the output files might be different because the columns are not preserved.</p>