title: How do you get two functions to return when using a user-defined function?
body: <p>I am just starting to use user-defined functions, so this is probably not a very complex question, forgive me. </p>
  
  <p>I have a few dataframes, which all have a column named 'interval_time' (for example) and I would like to rename this column 'Timestamp', and then make this renamed column into the index. </p>
  
  <p>I know that I can do this manually with this; </p>
  
  <pre><code>df = df.rename(index=str, columns={'interval_time': 'Timestamp'})
  df = df.set_index('Timestamp')
  </code></pre>
  
  <p>but now I would like to define a function called rename that does this for me. I have seen that this works; </p>
  
  <pre><code>def rename_col(data, col_in='tempus_interval_time', col_out='Timestamp'):
      return data.rename(index=str, columns={col_in: col_out}, inplace=True)
  </code></pre>
  
  <p>but when I try to add the second function it does not seem to do anything, but if I define the second part as its own function and run it it does seem to work. </p>
  
  <p>I am trying this</p>
  
  <pre><code>def rename_n_index(data, col_in='tempus_interval_time', col_out='Timestamp'):
      return data.rename(index=str, columns={col_in: col_out}, inplace=True)
      return data.set_index('Timestamp', inplace=True)
  </code></pre>
  
  <p>The dataframes that I am using have the following form; </p>
  
  <pre><code>df_scada
                interval_time                 A         ...             X                 Y 
  0       2010-11-01 00:00:00                0.0        ...                396.36710         381.68860
  1       2010-11-01 00:05:00                0.0        ...                392.97974         381.40634
  2       2010-11-01 00:10:00                0.0        ...                390.15695         379.99493
  3       2010-11-01 00:15:00                0.0        ...                389.02786         379.14810
  </code></pre>