0

I currently have this set of data:

0   1955   22.5  126.037736
1   1955    0.0  148.773585
2   1957   22.5    0.000000
3   1958   22.5   22.735849
4   1958    0.0   82.169811
5   1960   22.5   52.264151
6   1962    0.0   47.169811
7   1965    0.0   56.037736
8   1973    0.0   12.264151
9   1975   22.5   92.735849
10  1983    0.0  123.962264
11  1984   22.5  110.000000
12  1984   22.5   68.301887
13  1986    0.0   10.566038
14  1987   22.5  115.471698
15  1994   22.5   48.867925
16  1995  359.5   19.339623
17  2003   22.5   17.358491
18  2006  359.5   85.566038
19  2009   10.5   24.433962
20  2013   20.5   19.339623

I would like to remove the double up of years (ie. 1955, 1984 and 1984), but only remove the value that isn't the maximum in column three (ie, row 0 would be removed < 148.77).

I am using python, with pandas and numpy.

Any help is greatly appreciated.

  • What is expected output? Possible [dupe](https://stackoverflow.com/q/15705630) – jezrael Apr 04 '19 at 06:46
  • I basically only want to remove rows 0, 3, and 12. But I want to write a small script that does this automatically using pandas, as I have a much larger set of data that I need to sort the same way. So keep the years unique, and filter the data so that only the maximum value in column 3 of each row is kept. – ihavenoideawhatimdoing Apr 04 '19 at 06:50
  • 1
    Check dupe, it is exactly what need. – jezrael Apr 04 '19 at 06:51

0 Answers0