Data storytelling builds compelling stories extracted from data to engage and inspire the audience to make decisions. In this course, you will learn Python Altair to perform data storytelling. Altair is a Python library for data visualization. Built on top of the Vega and Vega-Lite grammars, Altair also provides an API for creating charts and visualizations.

Altair is similar to Matplotlib in that we can use it to create a variety of different types of charts and visualizations. However, Altair enables the creation of interactive visualizations, while Matplotlib focuses more on static visuals. We can even use Altair to create web-based visualizations embedded in websites or applications.

How is this course organized?

This course is divided into the following eleven chapters:

Press + to interact
Course organization
Course organization

What is Data Storytelling?

The first chapter of the course describes the main concepts of data storytelling, focusing on the main actors involved in a data story: the data, the target audience, the message to communicate, and the storyteller. This chapter also describes the key points of looking at a data story from the audience’s point of view and some strategies to communicate a message effectively.

Using Altair for Data Storytelling

In the second chapter, we focus on the Altair foundations: encodings and marks. We also describe Vega and Vega-lite, the grammar languages behind Altair. We describe some practical step-by-step examples to start using Altair as a visualization library.

The DIKW pyramid

This chapter introduces the Data-Information-Knowledge-Wisdom (DIKW) pyramid and how to use it for data storytelling. Using the DIKW pyramid for data storytelling helps us follow a systematic approach to building data stories.

Press + to interact
The DIKW pyramid
The DIKW pyramid

This chapter also introduces the main concepts of turning data into information, information into knowledge, and knowledge into wisdom.

Press + to interact
Course chapters describing data
Course chapters describing data

Introducing the Concept of Data

In chapter four, we focus on data and how to manage it in Altair. We describe the supported data types and how to perform data cleaning and enrichment in Altair. We also discuss problems related to data licenses.

This chapter also includes some practical step-by-step examples that help you get familiar with data in Altair.

Getting Familiar with Unknown Data

This chapter illustrates the main chart types and how to implement them in Altair: bar charts, line charts, area charts, scatter plots, box plots, pie charts, heatmaps, and geographical maps. This part also describes when we should use each of them and when we should not use them. This part is rich in practical examples and exercises.

Press + to interact
Course chapters describing information
Course chapters describing information

Introducing the Concept of Information

In this chapter, we focus on the concept of information and how to choose the right questions for our data. We also describe how to extract meaning from data: decluttering, aggregation, binning, ordering, and scaling. This chapter is rich in practical examples and exercises in Altair.

Data Modeling

This chapter describes the main modeling techniques supported by Altair: regression and kernel density estimation (KDE). After a brief introduction of the models, we provide some practical examples in Altair.

Press + to interact
Course chapters describing knowledge
Course chapters describing knowledge

Knowledge

In this chapter, we illustrate the concept of knowledge and how to add context to information. We also describe how to add a title, subtitle, and annotation to an Altair chart. Then, we focus on some general concepts of data visualization, including how to credit images and data sources, choose the colors and sizes of a chart, and add interactivity to a graph. Finally, we show how to reduce bias in a chart to prevent the audience from perceiving a message in the wrong way.

Press + to interact
Course chapters describing wisdom
Course chapters describing wisdom

Wisdom

This chapter describes the concept of wisdom and how to turn knowledge into wisdom. We describe how to combine multiple charts in Altair, and how to add a call to action to inspire the audience. Finally, we describe how to publish a complete story implemented in Altair on the web.

Case Studies

This chapter describes two specific case studies by applying all the concepts learned during the course: the bike vendor case study and the small restaurant case study.

Appendix

In this final chapter, we describe how to install Altair and how to run it into a Docker container.

Prerequisites

This course assumes knowledge of the Python programming language, focusing on pandas and some basic concepts related to the JSON format.

Who is this course for?

This course is going to be useful for anyone who wants to learn Altair or data storytelling with Altair.

Learning outcomes

At the end of this course, you will have gained proficiency in the following:

  • Basic concepts of data storytelling

  • Fundamentals of Python Altair

  • The ability to turn raw data into data stories through Python Altair

  • Basic topics of data visualization.

Apart from achieving these learning outcomes, you will also create two complete Altair projects from scratch at the end of this course.