text_html_output_1.png
from wordcloud import WordCloud, STOPWORDS

import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

df = pd.read_excel('../input/tweets.xlsx', sheet_name='tweets')

toptweeps = df.groupby('username')[['tweet ']].count()
toptweeps.sort_values('tweet ', ascending=False)[:10]

topretweets = df.groupby('username')[['retweets']].sum()
topretweets.sort_values('retweets', ascending=False)[:10]

corpus = ' '.join(df['tweet '])
corpus = corpus.replace('.', '. ')
wordcloud = WordCloud(stopwords=STOPWORDS, background_color='white', width=2400, height=2000).generate(corpus)
plt.axis('off')

mest = df[df['username'] == 'MESTAfrica']
corpu = ' '.join(df['tweet '])
corpu = corpu.replace('.', '. ')
wordcloud = WordCloud(stopwords=STOPWORDS, background_color='white', width=2400, height=2000).generate(corpu)
plt.axis('off')

tony = df[df['username'] == 'TonyElumeluFDN']
corp = ' '.join(df['tweet '])
corp = corp.replace('.', '. ')
wordcloud = WordCloud(stopwords=STOPWORDS, background_color='white', width=2400, height=2000).generate(corp)
plt.figure(figsize=(12, 15))
plt.imshow(wordcloud)
plt.axis('off')
plt.show()