I am trying to change the column name of one set of duplicate columns in the dataframe. I form the dataframe from two different csv files after a bunch of pre-processing.
merged_df.columns
is this:
Index(['PortfolioID', 'FirmID', 'PC_City', 'PC_State', 'PC_Country',
'Investment_Date', 'Exit_Date', 'Transaction_Comments', 'PC_City',
'PC_State', 'PC_Country',
'fundSize'],
dtype='object')
The first set of PC_City, PC_State, PC_Country
is for portfolio companies and the next set is for the firms. I tried this but made both the sets same. Then I saw this but it can be done only when importing the csv. This doesn't talk about duplicates.
Is there any way I can achieve this? Mods please help with the editing.