Last active
December 29, 2019 02:27
-
-
Save mapmeld/39c1700e8793349f81228735dd8f595c to your computer and use it in GitHub Desktop.
LangSum.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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