Hello, I have a dataset with village names and their respective populations. Villages belong to different districts. The data structure looks like below:
I want to get a unique dataset by dropping the duplicate villages. But while dropping, I want to keep the village name with higher population, in the example above I want to keep chak 15 with 40 people and not 30.
How can I do so? Please let me know.
Thanks.
Village_name | District | pop |
shahpur | A | 10 |
ali pur | B | 20 |
chak 15 | B | 30 |
chak 15 | B | 40 |
chak 20 | C | 50 |
How can I do so? Please let me know.
Thanks.
Comment