title: Rename Pandas DataFrame inside function does not work
body: <p>I want to implement this function in order to create new columns with new names. If I apply line by line the code works perfectly. If I run the function, the line lag.columns = [rename] does not work. </p>
  
  <p>What is happening?</p>
  
  <pre><code>T  = [50, 48, 47, 49, 51, 53, 54, 52]
  v1 = [1, 3, 2, 4, 5, 5, 6, 2] 
  v2 = [2, 5, 4, 2, 3, 1, 6, 9]
  
  dataframe = pd.DataFrame({'T': T, 'v1': v1, 'v2': v2})
  
  
  def timeseries_to_supervised(data, ts=1, dropnan=True):
      '''
      Helper function to convert a timeseries dataframe to supervised
      The response must be placed as the first column
      Arguments:
          :data --&gt; dataframe to transform into supervised
          :timesteps --&gt; number of timesteps we want to shift
      Returns:
          :final --&gt; numpy array transformed        
      ''' 
      # n_vars = 1 if type(data) is list else data.shape[1]
      # y = data.loc[1]
  
      # Create lags
      for i, col in enumerate(list(data)):
  
          name = col
          rename = name + '(t-1)'
          lag  = pd.DataFrame(data.iloc[:, i]).shift(1)
          lag.colums = [rename]
          data = pd.concat([data, lag], axis=1)
  
      return data
  
  reframed = timeseries_to_supervised(dataframe, 1)
  </code></pre>
  
  <p>So, it is returning the data frame with the new columns but the names of the columns don't include the changing part.</p>
  
  <p>Thanks in advance!</p>