Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas drop duplicates but keep most recent date

df.sort_values('DATE_CHANGED').drop_duplicates('STATION_ID',keep='last')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #drop #duplicates #date
ADD COMMENT
Topic
Name
1+9 =