title: Rename only the last column in pandas dataframe (accounting for duplicate headers)
body: <p>I need to rename <strong>only</strong> the last column in my dataframe, the issue is <strong>there are many columns with the same name</strong> (there is a reason for this), thus I cannot use the code in other examples online. Is there a way to use something specific that just isolates the final column?</p>
  
  <p>I have tried to do something like this
  <code>df.rename(columns={df.columns[-1]: 'Test'}, inplace=True)</code></p>
  
  <p>However this then means that all columns with that same header are changed to 'Test', whereas I just want the last one to change.</p>
  
  <p>I kind of need something like <code>df.columns[-1] = 'Test'</code>  but this doesn't work.</p>