Delightful Figures in Python Series: Word Cloud

Brinnae Bent, PhD
Analytics Vidhya
Published in
5 min readSep 11, 2020

--

I wanted to put together a series to guide Python-ers through generating delightful figures. Delightful figures can help you effectively tell your story, add credibility to your data analysis, and give your papers/articles/blogs a pop of fun. Click here for Part 1 of the series, focused on donut plots!

Here in Part 2 of the series, we will be learning how to create word clouds in Python using the WordCloud library developed by Andreas Mueller. Word clouds, also known as “word maps” or “wordles”, are nifty visualizations that can show frequency of text in a document or, as we will show here, a column in a dataframe. The gist of word clouds is that they give greater prominence, or emphasis, to words that appear more frequently in the text.

Getting Started

Some basic assumptions before we get started: I am assuming you have, at minimum, a basic understanding of python and you have a working knowledge of pandas and matplotlib. You will also want to install the wordcloud library and the PIL library, if you do not yet have these. This can be done via pip or conda.

The dataset

This tutorial is BYODS (Bring your own data set), but if you want to follow along with the dataset I am using, I am using the Kaggle UFO sightings dataset, available here.

--

--