title: DataFrame modified inside a function
body: <p>I face a problem of modification of a dataframe inside a function that I have never observed previously. Is there a method to deal with this so that the initial dataframe is not modified.</p>
  <pre><code>In[30]: def test(df):
      df['tt'] = np.nan
      return df
  
  In[31]: dff = pd.DataFrame(data=[])
  
  In[32]: dff
  
  Out[32]: 
  Empty DataFrame
  Columns: []
  Index: []
  In[33]: df = test(dff)
  
  In[34]: dff
  
  Out[34]: 
  Empty DataFrame
  Columns: [tt]
  Index: []
  </code></pre>