I have a dataset like this one:
+----------+------------+
|id |event |
+----------+------------+
| 1 |A |
| 2 |B |
| 3 |C |
| 4 |C |
| 5 |A |
| 6 |D |
| 7 |B |
+----------+------------+
And I would like either to modify id or add another column where all the equal values in column "event" have the same id. And I would like the rows to remain in the same order as they are now.
This is how I would like the data to look at the end (the value of "id" doesn't matter as long as it's unique for each event)
+----------+------------+
|id |event |
+----------+------------+
| 1 |A |
| 2 |B |
| 3 |C |
| 3 |C |
| 1 |A |
| 4 |D |
| 2 |B |
+----------+------------+