Skip to content

Instantly share code, notes, and snippets.

@vi3k6i5
Created January 4, 2017 07:00
Show Gist options
  • Save vi3k6i5/3bdd4fdaca7e41553a1432f1a1c37121 to your computer and use it in GitHub Desktop.
Save vi3k6i5/3bdd4fdaca7e41553a1432f1a1c37121 to your computer and use it in GitHub Desktop.
# part solution to http://stackoverflow.com/questions/41447277/trouble-using-pandas-read-html/41447560#41447560
max_value = [0,0]
for item in [(int(val.split('/')[0]), int(val.split('/')[1])) for val in df['Date Posted'].values]:
if item[0] > max_value[0]:
max_value[0] = item[0]
elif item[0] == max_value[0]:
if item[1] > max_value[1]:
max_value[1] = item[1]
max_date_posted = str(max_value[0]) + '/' + str(max_value[1])
df[df['Date Posted'] == max_date_posted]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment