Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dwo
Last active May 22, 2017 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwo/3eb0a1b200dd3c4916d2fd051ab46ee5 to your computer and use it in GitHub Desktop.
Save dwo/3eb0a1b200dd3c4916d2fd051ab46ee5 to your computer and use it in GitHub Desktop.
import csv
import re
tweets = set()
with open('tweets.csv', 'rb') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
tweet = unicode(row[5], 'utf-8')
tweets.add(tweet)
with open('tweets.txt', 'w') as out:
out.write(str(list(tweets)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment