title: Python - Create An Empty Pandas DataFrame and Populate From Another DataFrame Using a For Loop
body: <p>Using: Python 2.7 and Pandas 0.11.0 on Mac OSX Lion</p>
  
  <p>I'm trying to create an empty <code>DataFrame</code> and then populate it from another dataframe, based on a <code>for loop</code>.</p>
  
  <p>I have found that when I construct the <code>DataFrame</code> and then use the <code>for loop</code> as follows:</p>
  
  <pre><code>data = pd.DataFrame()
  for item in cols_to_keep:
      if item not in dummies:
          data = data.join(df[item])
  </code></pre>
  
  <p>Results in an empty <code>DataFrame</code>, but with the headers of the appropriate columns to be added from the other <code>DataFrame</code>.</p>