Hello, my data looks like this
Each id appears twice because there are two distance values for each id. I would like to drop the larger distance value. For example, for id = 1, I want to keep 20 and drop 300.
I have tried combining the drop, by and sort commands, but so far nothing has worked for me.
id | distance |
1 | 300 |
1 | 20 |
2 | 500 |
2 | 450 |
3 | 6 |
3 | 780 |
4 | 9000 |
4 | 30 |
Each id appears twice because there are two distance values for each id. I would like to drop the larger distance value. For example, for id = 1, I want to keep 20 and drop 300.
I have tried combining the drop, by and sort commands, but so far nothing has worked for me.