Skip to content

Instantly share code, notes, and snippets.

@mapmeld
Last active December 29, 2019 02:27
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 mapmeld/39c1700e8793349f81228735dd8f595c to your computer and use it in GitHub Desktop.
Save mapmeld/39c1700e8793349f81228735dd8f595c to your computer and use it in GitHub Desktop.
LangSum.py
import pandas as pd
dflangsum = None
for doc in range(1, 10): # ends at 9
df = pd.read_csv("saudi_arabia_112019_tweets_csv_hashed_" + str(doc) + ".csv")
langcount = df[df['is_retweet'] == False].groupby(['tweet_language']).count()['tweetid']
if dflangsum is not None:
dflangsum += langcount
else:
dflangsum = langcount
df = None # memory
print(dflangsum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment