Have purchases of multiple parking passes per student per semester. Trying to delete them based which permit they had the longest. Combined student ID and semester in order to make the unique ID. There are 80 columns in the dataframe but for this purpose I am only dealing with 2.
UniqueID PermitDuration
01-Fall16 10
01-Fall17 11
01-Fall17 5
01-Fall17 11
02-Fall16 5
02-Fall16 12
02-Fall17 2
02-Fall17 6
I want to remove the duplicates of the UniqueID based on which one has the largest value in PermitDuration. The desired dataframe would look like this.
UniqueID PermitDuration
01-Fall16 10
01-Fall17 11
02-Fall16 12
02-Fall17 6