title: Programmatically slice a Pandas dataframe in place
body: <p>I have a bunch of dataframes that I am trying to slice and assign back to the original names. But I am finding that there is a namespace issue. Below is what I have.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  df_a = pd.DataFrame(np.random.rand(14,2), columns = list('XY'))
  df_b = pd.DataFrame(np.random.rand(14,2), columns = list('XY'))
  
  mylist =[df_a, df_b]
  
  def truncate_before(list_of_dfts, idx):
      for dfts in list_of_dfts:
          dfts = dfts[idx:]
          print(dfts.head)
  
  truncate_before(mylist, 11)
  print(df_a)
  </code></pre>
  
  <p>In the print statements within the truncate_before function, it shows 3 rows, corresponding to the 11th, 12th and 13th row. But the final print statement shows 0th to 13th rows. </p>
  
  <p>So outside the function, it reverts back to the original dataframes. I was under the impression that Python passes arguments by reference. What am I missing?</p>