title: python pandas function df pointer doesn't change values
body: <p>I'm trying to give a function a pointer to an existing df, and trying to copy values from one df to another. but after the function is finished, the values are not assigned to the original object.</p>
  <p>how to recreate:</p>
  <pre><code>import pandas as pd
  
  
  def copy(df, new_df):
      new_df = df.copy()
      # an example of things that would be modified on new_df
      new_df[0] = &quot;test&quot;
      # just editing df as an example, to show that df is being changed while new_df is not receiving the values 
      df[0] = &quot;test&quot;
  
  
  if __name__ == '__main__':
  
      mat = [
          [1, 2, 3],
          [4, 5, 6],
          [7, 8, 9]
      ]
  
      df = pd.DataFrame(mat)
      new_df = pd.DataFrame()
  
      copy(df, new_df)
  
      print(new_df)
  </code></pre>
  <p>if you notice, in this case i am assigning &quot;test&quot; to the first column, in this case it does assign the values to the original object from the pointed object, but new_df do not get the new values.</p>
  <p>is this a bug in pandas? or am i doing something wrong?</p>
  <p>edit:</p>
  <p>the assigning of values to <code>df[0]</code> is just an example of how the values do change on the original <code>df</code>.
  my question is, how do i assign the values from the original df to a new df(it could also be concat, not only copy) without having to return the df and create a new variable which receives the returned value from the function</p>