title: Pandas - Append rows to DataFrames as elements in a list, not working
body: <p>I have a list of dataframes that looks like this:</p>
  
  <pre><code>mylist=[pd.DataFrame({'a':[5,5],'b':[5,5]}),pd.DataFrame({'a':[6,6],'b':[6,6]})]
  </code></pre>
  
  <p>and a separate datframe (df) that I want to append to the bottom of the two dataframes in mylist. </p>
  
  <pre><code>df=pd.DataFrame({'a':[9],'b':[9]})
  </code></pre>
  
  <p>When I append by looping over mylist, the append works on the element of the list, but it does not update or change mylist.   </p>
  
  <pre><code>for i in mylist:
      i=i.append(df, ignore_index=True)
      print(i, '\n')
      print(mylist, '\n')
  
     a  b
  0  5  5
  1  5  5
  2  9  9 
  
  [   a  b
   0  5  5
   1  5  5,
      a  b
   0  6  6
   1  6  6] 
  
      a  b
   0  6  6
   1  6  6
   2  9  9 
  
  [   a  b
   0  5  5
   1  5  5,
      a  b
   0  6  6
   1  6  6] 
  </code></pre>
  
  <p>I have tried multiple ways around this by using concat and by merging on 'a' and I get the same general result-- the dataframe elements are modified within the loop, but after the loop finishes nothing has changed.</p>
  
  <p>When I try to make the same changes but without using a loop, then mylist <em>is</em> updated.</p>
  
  <pre><code>mylist[0]=mylist[0].append(df, ignore_index=True)
  print(mylist[0])
  print(mylist)
  
     a  b
  0  5  5
  1  5  5
  2  9  9
  
  [   a  b
   0  5  5
   1  5  5
   2  9  9,
      a  b
   0  6  6
   1  6  6]
  </code></pre>
  
  <p>Can someone please explain why this behavior happens in the for loop?  Thank you!</p>