Creating a wordcloud

A worldcloud is a collage of words and those words that are bigger in size have a high frequency.

You can download wordcloud with the following command if you use Ubuntu:

$ pip install git+git://github.com/amueller/word_cloud.git

You can follow the instructions to do this by referring to https://github.com/amueller/word_cloud.

Let's plot the wordcloud for the BBC by using the following code:

>>> wordcloud = WordCloud(width = 1000, height = 500).generate(' '.join(data['bbc']))

>>> plt.figure(figsize=(15,8))

>>> plt.imshow(wordcloud)

>>> plt.axis("off")

>>> plt.show()
Creating a wordcloud

From the preceding wordcloud, we can make out that there are ...

Get Mastering Python for Data Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.