title: Return output of function that takes pandas dataframe as a parameter
body: <p>I have a pandas dataframe that looks like:</p>
  
  <pre><code>d = {'some_col' : ['A', 'B', 'C', 'D', 'E'],
       'alert_status' : [1, 2, 0, 0, 5]}
  df = pd.DataFrame(d)
  </code></pre>
  
  <p>Quite a few tasks at my job require the same tasks in pandas. I'm beginning to write standardized functions that will take a dataframe as a parameter and return something. Here's a simple one:</p>
  
  <pre><code>def alert_read_text(df, alert_status=None):
      if (alert_status is None):
          print 'Warning: A column name with the alerts must be specified'
      alert_read_criteria = df[alert_status] &gt;= 1
      df[alert_status].loc[alert_read_criteria] = 1
      alert_status_dict = {0 : 'Not Read',
                           1 : 'Read'}
      df[alert_status] = df[alert_status].map(alert_status_dict)
      return df[alert_status]
  </code></pre>
  
  <p>I'm looking to have the function return a series. This way, one could add a column to an existing data frame:</p>
  
  <pre><code>df['alert_status_text'] = alert_read_text(df, alert_status='alert_status')
  </code></pre>
  
  <p>However, currently, this function will correctly return a series, but also modifies the existing column. How do you make it so the original column passed in does not get modified?</p>