Im new to pyspark dataframes,I have input dataframe in below format :
| ID | Value |
|---|---|
| 1 | CAR1_V1 |
| 2 | CAR1_V2 |
| 3 | CAR1_V3 |
| 4 | CAR2_V1 |
| 5 | CAR2_V2 |
| 6 | CAR3_V1 |
| 7 | CAR3_V1 |
Now I need to convert it in below format :
| ID | Value |
|---|---|
| 3 | CAR1_V3 |
| 5 | CAR2_V2 |
| 7 | CAR3_V1 |
Not only duplicates need to remove also have to keep the last occurance of values(like data between underscore have to consider separately.