How to use Data Science Superpowers for Useless Things: Finding an Old Article

1 minute read

  1. Get sent an article years ago that is super profound
  2. Forget about it for some more years
  3. Think about it and try to find it
  4. … fail miserably
  5. Contact the person who sent you the article
  6. … they too cannot find
  7. Panic. Panic horribly. This is your worst fear. How will you ever be able to exist in a world where you cannot find things you’ve read about?
  8. SOLUTION: set up an email account JUST for forwarding things to that you don’t want to forget.
  9. PROBLEM: This email address is now full
  10. SOLUTION: export??!
  11. While unpacking why you did this to yourself, you remember The Article
  12. You also remember that you recently searched through all your old text messages (yes, this is something you do because (1) you export your text messages on a yearly basis for searching purposes (2) you like having a little “journal” of what you were doing that day)
  13. You re-open this document in google sheets and then realize you should 100% be doing this with python
  14. Start a new python file and get to work.
  15. Create a subset of the data that is ONLY the conversations between you and the person who sent you the article
  16. Search through the smaller DB for the word “article”
  17. Find it within four minutes. Win forever.
import pandas as pd

df = pd.read_csv('Messages_06_2015_to_08_2019_all - Messages_06_2015_to_08_2019_all.csv')
df.columns = ['status', 'datetime', 'person', 'number','text']
derek = df[df['person'] == "Derek Schulte"]
derek
df = derek.copy()
df_text = df[df['text'].str.contains("article")]
for text in df_text['text']:
    print(text)

Tags:

Updated: