I have a data frame that looks like this:
Contract_ID | Agreement_Date |
---|---|
1 | 05/04/1997 |
1 | 03/02/1997 |
2 | 05/08/2020 |
2 | 08/07/2020 |
3 | 05/07/2020 |
3 | 09/08/2020 |
I would like to create a new Agreement_Date_x column populated by the Agreement_Date from the duplicated Contract_ID. In summary, I would like an output like this:
Contract_ID | Agreement_Date | Agreement_Date_x |
---|---|---|
1 | 05/04/1997 | 03/02/1997 |
2 | 05/08/2020 | 08/07/2020 |
3 | 05/07/2020 | 09/08/2020 |
This is not show-cased in my example, but some Contract_IDs have 3+ duplicates (all with different Agreement_Dates). I would like to create a separate column for each duplicate.
Thank you kindly