title: Type error after renaming Pandas Dataframe columns
body: <p>Problem description: I have two dataframes ('Train' and 'Test') with nearly identical columns('Test' has two variables that don't appear in Train, and Train has one variable that doesn't appear in Test; however, to produce "Test", I needed to do some processing in R, because I couldn't figure out how to do the equivalent of PLYR's full join in Pandas.  The end result was that all spaces and apostrophes were replaced with periods in the R dataframe names in Test.  </p>
  
  <p>My current problem is that I need to have identical variable names in both dataframes(minus the extra one in Test).  My current attempt is the following:</p>
  
  <pre><code>Test.columns[2:]=Train.columns[1:]
  After index points 2 and 1, columns are the same
  </code></pre>
  
  <p>This appears to nominally work;  when I enter</p>
  
  <pre><code>Test.columns
  </code></pre>
  
  <p>I get the expected output. However, problems come up later.  I'm trying to delete a column in Train if a condition is met, and the same column in Test.</p>
  
  <pre><code>for i in Train.columns[1:]:
       if condition:
          del Train[i]
          del Test[i]
  </code></pre>
  
  <p>Which produces</p>
  
  <pre><code>TypeError: 'NoneType' object is not iterable
  </code></pre>
  
  <p>I get the same error if I just put in </p>
  
  <pre><code>Test
  </code></pre>
  
  <p>but get the expected output if I put in something like</p>
  
  <pre><code>Test['varname']
  </code></pre>
  
  <p>I suppose I was hoping someone would immediately recognize whatever grave sin I committed in my column name reassignment that is generating the type error (I have no problem if I'm just deleting from Train), or suggest an alternative way to change the column names.  </p>
  
  <p>I greatly appreciate any help.</p>