Skip to content

emonson/altair-vis-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visualizing data in Python with Altair

This is a introductory-level workshop given through Duke University's Center for Data and Visualization Sciences on how to use Altair to visualize and explore data within JupyterLab.

Installs

I recommend using the Anaconda Python distribution as an easy way to get Python, JupyterLab, and Altair. Anaconda comes with Altair installed, but if you're not using the Anaconda distribution you should follow the Altair installation guide.

pip install altair vega_datasets

or

conda install -c conda-forge altair vega_datasets

The numbered lessons above have been updated to use Altair 5, which has some new features and syntax not present in the workshop videos below.

I have also started using VegaFusion to get around the MaxRowsError when visualizing data with more than 5000 rows, and the speed issues associated with having Altair (really Vega-Lite and JavaScript in the background) do your data aggregation, filtering, and transformations. This doesn't come with Anaconda, so you'll need to install the modules and associated Jupyter extensions with:

pip install "vegafusion[embed]"
pip install "vegafusion-jupyter[embed]"

You might also want to install vl-convert for saving plots to SVG or PNG right from your code (rather than clicking buttons).

pip install vl-convert-python

Workshop videos

There is a recording of a workshop from Fall 2021, and you can download a PDF of the slides from the lecture portion.

I also have a recording of a previous workshop called Pandas 101 – Intro to Tabular Data in Python and JupyterLab, which might be good to watch before this one if you're not familiar with JupyterLab or manipulating tabular data in Python with Pandas.

Neither workshop teaches the basics of the Python programming language, and it's probably helpful to have seen some Python before this if you're going to make any sense out of the material. But, you don't have to be very advanced to learn something from these videos!