I have a dataframe which will automatically generate multiple columns like result1, result2, result3, result4 etc. I want to rename the last result i.e result4 in this case. The number of columns will be new everytime so I can't use command like
df.rename(columns={'result4': 'Final_result'}, inplace=True)
How can I do it? what command will be good to achieve this?