date county state cases deaths FIPS
1: 2020-01-21 Snohomish Washington 1 0 53061
2: 2020-01-22 Snohomish Washington 3 0 53061
3: 2020-01-23 Snohomish Washington 5 1 53061
4: 2020-01-24 Cook Illinois 1 0 17031
5: 2020-01-24 Snohomish Washington 5 1 53061
6: 2020-01-25 Orange California 1 0 6059
7: 2020-01-25 Los Angeles California 2 0 6037
8: 2020-01-25 Snohomish Washington 5 2 53061
9: 2020-01-26 Maricopa Arizona 1 0 4013
10: 2020-01-26 Los Angeles California 17 0 6037
11: 2020-01-27 Maricopa Arizona 3 1 4013
12: 2020-01-28 Cook Illinois 2 2 17031
I would like to take the lowest row for each county
(aka the most recent data, since the data are organized by date). I would like to delete all old data. Some counties most recent data are in January, some is in March (not shown). My df1 is about 15,000 rows long. How can this be done? Output should be:
date county state cases deaths FIPS
6: 2020-01-25 Orange California 1 0 6059
8: 2020-01-25 Snohomish Washington 5 2 53061
10: 2020-01-26 Los Angeles California 17 0 6037
11: 2020-01-27 Maricopa Arizona 3 1 4013
12: 2020-01-28 Cook Illinois 2 2 17031