I have a dataframe as given below, I want to display only the rows with highest values on comparing with its duplicate city.
City | ID | Value |
Denmark | 1 | 11 |
Amsterdam | 1 | 16 |
Canada | 1 | 17 |
New York | 1 | 23 |
Bulgaria | 1 | 14 |
Bulgaria | 1 | 20 |
Output:
City | ID | Value |
Denmark | 1 | 11 |
Amsterdam | 1 | 16 |
Canada | 1 | 17 |
New York | 1 | 23 |
Bulgaria | 1 | 20 |
By dropping the duplicate values and sorting it on descending order:
Output: