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://

You can follow the instructions to do this by referring to

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")

Creating a wordcloud

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

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.