title: Adding Column headers to pandas dataframe.. but NAN's all the data even though headers are same dimension
body: <p>I am trying to add column headers to csv file that I have parsed into a dataframe withing Pandas.</p>
  
  <pre><code>dfTrades = pd.read_csv('pnl1.txt',delim_whitespace=True,header=None,);
  dfTrades = dfTrades.drop(dfTrades.columns[[3,4,6,8,10,11,13,15,17,18,25,27,29,32]], axis=1)     # Note: zero indexed
  dfTrades = dfTrades.set_index([dfTrades.index]);
  df = pd.DataFrame(dfTrades,columns=['TradeDate',
                                        'TradeTime',
                                        'CumPnL',
                                        'DailyCumPnL',
                                        'RealisedPnL',
                                        'UnRealisedPnL',
                                        'CCYCCY',
                                        'CCYCCYPnLDaily',
                                        'Position',
                                        'CandleOpen',
                                        'CandleHigh',
                                        'CandleLow',
                                        'CandleClose',
                                        'CandleDir',
                                        'CandleDirSwings',
                                        'TradeAmount',
                                        'Rate',
                                        'PnL/Trade',
                                        'Venue',
                                        'OrderType',
                                        'OrderID'
                                        'Code']);
  
  
  print df
  </code></pre>
  
  <p>The structure of the data is:</p>
  
  <pre><code>01/10/2015 05:47.3  190 190 -648 838 EURNOK -648 0  0 611   -1137   -648 H 2     -1000000   9.465   -648    INTERNAL    IOC 287 AS
  </code></pre>
  
  <p>What Pandas returns is:</p>
  
  <pre><code>  TradeDate  TradeTime  CumPnL  DailyCumPnL  RealisedPnL  UnRealisedPnL  \
  0            NaN        NaN     NaN          NaN          NaN            NaN   ...
  </code></pre>
  
  <p>I would appreciate any advice on the issue.</p>
  
  <p>Thanks</p>
  
  <p>Ps.
  Thanks to Ed for his answer.
  I have tried your suggestion with</p>
  
  <pre><code>df = dfTrades.columns=['TradeDate',
                     'TradeTime',
                     'CumPnL',
                     'DailyCumPnL',
                     'RealisedPnL',
                     'UnRealisedPnL',
                     'CCYCCY',
                     'CCYCCYPnLDaily',
                     'Position',
                     'CandleOpen',
                     'CandleHigh',
                     'CandleLow',
                     'CandleClose',
                     'CandleDir',
                     'CandleDirSwings',
                     'TradeAmount',
                     'Rate',
                     'PnL/Trade',
                     'Venue',
                     'OrderType',
                     'OrderID'
                     'Code'];
  </code></pre>
  
  <p>But now the problem has morphed to:</p>
  
  <pre><code> ValueError: Length mismatch: Expected axis has 22 elements, new values have     21 elements
  </code></pre>
  
  <p>I have taken the shape of the matrix and got:
      dfTrades.shape</p>
  
  <pre><code>(12056, 22)
  </code></pre>
  
  <p>So sadly i still need some help :(</p>