Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
another small readme adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelharms committed Jan 19, 2020
1 parent 3b475ab commit 48f9e66
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ import pandas as pd
client = IndexClient()
client.search("reddit.com/r/MachineLearning/*")

df = pd.DataFrame(client.results)
sorted_df = df.sort_values(by="timestamp")
filtered_df = sorted_df.drop_duplicates("urlkey", keep="last")
client.results = (pd.DataFrame(client.results)
.sort_values(by="timestamp")
.drop_duplicates("urlkey", keep="last")
.to_dict("records"))

client.results = filtered_df.to_dict("records")
client.download()

pd.DataFrame(client.results).to_csv("results.csv")
Expand Down

0 comments on commit 48f9e66

Please sign in to comment.