title: python pandas remove duplicate columns
body: <p>What is the easiest way to remove duplicate columns from a dataframe?</p>
  
  <p>I am reading a text file that has duplicate columns via:</p>
  
  <pre><code>import pandas as pd
  
  df=pd.read_table(fname)
  </code></pre>
  
  <p>The column names are:</p>
  
  <pre><code>Time, Time Relative, N2, Time, Time Relative, H2, etc...
  </code></pre>
  
  <p>All the Time and Time Relative columns contain the same data. I want:</p>
  
  <pre><code>Time, Time Relative, N2, H2
  </code></pre>
  
  <p>All my attempts at dropping, deleting, etc  such as:</p>
  
  <pre><code>df=df.T.drop_duplicates().T
  </code></pre>
  
  <p>Result in uniquely valued index errors:</p>
  
  <pre><code>Reindexing only valid with uniquely valued index objects
  </code></pre>
  
  <p>Sorry for being a Pandas noob. Any Suggestions would be appreciated.</p>
  
  <hr>
  
  <p><strong>Additional Details</strong></p>
  
  <p>Pandas version: 0.9.0<br>
  Python Version: 2.7.3<br>
  Windows 7<br>
  (installed via Pythonxy 2.7.3.0)</p>
  
  <p>data file (note: in the real file, columns are separated by tabs, here they are separated by 4 spaces):</p>
  
  <pre><code>Time    Time Relative [s]    N2[%]    Time    Time Relative [s]    H2[ppm]
  2/12/2013 9:20:55 AM    6.177    9.99268e+001    2/12/2013 9:20:55 AM    6.177    3.216293e-005    
  2/12/2013 9:21:06 AM    17.689    9.99296e+001    2/12/2013 9:21:06 AM    17.689    3.841667e-005    
  2/12/2013 9:21:18 AM    29.186    9.992954e+001    2/12/2013 9:21:18 AM    29.186    3.880365e-005    
  ... etc ...
  2/12/2013 2:12:44 PM    17515.269    9.991756+001    2/12/2013 2:12:44 PM    17515.269    2.800279e-005    
  2/12/2013 2:12:55 PM    17526.769    9.991754e+001    2/12/2013 2:12:55 PM    17526.769    2.880386e-005
  2/12/2013 2:13:07 PM    17538.273    9.991797e+001    2/12/2013 2:13:07 PM    17538.273    3.131447e-005
  </code></pre>