I have pandas dataframe like this
| Column 1 | Column 2 |
|---|---|
| 1 | a |
| 2 | a |
| 3 | b |
| 4 | c |
| 5 | d |
I want to name the column 2 as:
| Column 1 | Column 2 |
|---|---|
| 1 | row1 |
| 2 | row1 |
| 3 | row2 |
| 4 | row3 |
| 5 | row4 |
I am trying the ways that are hard coded, like renaming each column, but in practice I have lots of rows so hard coding is not possible, is there any function or something python that can do the same task for me?