Hi
I have a matrix below:
NaN NaN
518460 3.3220
518460 -12.9840
518520 3.7890
518520 -10.2800
518580 7.6730
518580 16.8510
518640 5.9590
.
.
.
the values in the 1st column are repeated (2-4 times). i want to write a code which checks the values in the 1st column, if it is repeated, then it will read the respective 2nd column values and only keep the row with the largest 2nd column value while deleting the other rows. so the matrix above when ran through the code should be:
518460 3.3220
518520 3.7890
518580 7.6730
518580 16.8510 .
.
.
the data exceeds over 1000 entries but i have only given a small piece of it above.
how can i write the code so i get my second matrix from the first.
Best Answer