This lesson is in the early stages of development (Alpha version)

Interactive Data Visualizations in Python

This workshop lesson is an introduction to making interactive data visualizations in Python. Learners will create a new environment using conda, wrangle data into the proper format using pandas library, create visualizations using the Plotly Python library, and display these visualizations and create widgets using Streamlit.

Preview the app

For a preview of what learners will be creating in this lesson (including the exercises), click the “Open in Streamlit” button below. Open in Streamlit The repository that contains this example Streamlit app can be found here.

Prerequisites

  1. Learners should have completed the Plotting and Programming in Python workshop lesson, or have some experience with Python and the pandas library.
  2. Learners should have Anaconda installed on their machines, as specified in the setup for Plotting and Programming in Python.
  3. Learners should be comfortable with using the command line.
  4. Learners should have a Jupyter Lab & Streamlit compatible web browser installed (Google Chrome, Firefox, or Safari).
  5. Learners should have downloaded the required files (data_viz_workshop.zip) as specified in the Setup
  6. (Optional) Learners can request a Streamlit Sharing account - request one here - if they wish to deploy and publish their visualization web app.

Schedule

Setup Download files required for the lesson
00:00 1. Create a New Environment How can I create a new conda environment?
00:10 2. Data Wrangling What format should my data be in for Plotly Express?
Why can’t I use the data in its current format?
What is tidy data?
How can I use pandas to wrangle my data?
00:25 3. Create Visualizations How can I create an interactive visualization using Plotly Express?
00:35 4. Create the Streamlit App How do I create a Streamlit app?
How can I see a live preview of my app?
00:45 5. Refactoring Code for Flexibility (Prepping for Widgets) How does the current code need to change in order to incorporate widgets?
What aspects of the code need to change?
What does it mean to ‘refactor’ code?
01:00 6. Add Widgets to the Streamlit App Why do I want to have widgets in my app?
What kinds of widgets are there?
How can I use widgets to alter my plot?
01:10 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.