PyGWalker Tutorial: A Tableau-Style Data Explorer in Jupyter and Streamlit
PyGWalker turns a pandas DataFrame into a Tableau-style drag-and-drop interface, inside a Jupyter notebook or a Streamlit app. One call renders the UI, and you build charts by dragging fields instead of writing plotting code.
Install PyGWalker
PyGWalker installs with pip and works on any pandas DataFrame. The video uses version 0.1.9; the code here is updated for PyGWalker 0.5. For the demo I use the tips dataset: total bill, tip, sex, smoker, day, time and party size.
pip install pygwalker
import pandas as pd
import pygwalker as pyg
df = pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv")
df.head()
total_bill tip sex smoker day time size
0 16.99 1.01 Female No Sun Dinner 2
1 10.34 1.66 Male No Sun Dinner 3
2 21.01 3.50 Male No Sun Dinner 3
3 23.68 3.31 Male No Sun Dinner 2
4 24.59 3.61 Female No Sun Dinner 4
Jupyter notebook
In a notebook, one call to pyg.walk with the DataFrame opens the interface in the output cell. The appearance argument sets the theme: ‘light’, ‘dark’ or ‘media’, which follows the system setting.
pyg.walk(df, appearance='light')
In the video the argument is called dark. Current versions ignore dark without an error, so use appearance.
The canvas has two tabs, Data and Visualization. The Data tab shows the DataFrame and how PyGWalker classified the columns: numeric values as measures, the rest as dimensions.

Build, filter and export charts
In the Visualization tab, you drag fields onto the x and y axes and PyGWalker draws a chart, picking a chart type for you. Dragging total_bill and day onto the axes gives the total bill per day; the layout mode lets you resize the chart.


You can switch to another chart type, such as a line chart, and add more fields, for example tip as a second measure on the y axis.
To filter, drag a column into the filter field and pick the values, for example only male customers. Drag it out again to remove the filter.

Each chart exports as PNG or SVG, and SVG stays sharp at any size.

A new tab next to the first chart starts another chart on the same data.

The chart configuration can be saved as well. The Code Export dialog shows the chart spec as JSON, and Export As saves it as a config file that recreates the same charts later, for example in a Streamlit app.

If you prefer a written report over a drag-and-drop canvas, an automatic EDA report in three lines of code is the other quick route.
Streamlit app
In Streamlit, you load the data and pass it to StreamlitRenderer together with the config.json exported from the notebook, so the canvas opens with your saved charts. PyGWalker 0.5.0.2 does not start in Streamlit 1.57 or newer (it fails with an ImportError), so pin Streamlit 1.56.0 for now.
pip install pygwalker "streamlit==1.56.0"
import pandas as pd
import streamlit as st
from pygwalker.api.streamlit import StreamlitRenderer
# Set page configuration
st.set_page_config(
page_title="PyGWalker Demo",
page_icon=":snake:",
layout="wide",
initial_sidebar_state="expanded",
)
# Load Data
@st.cache_data
def load_data(url):
df = pd.read_csv(url)
return df
df = load_data("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv")
# Set title and subtitle
st.title("PyGWalker Demo App")
st.subheader("A demonstration of the PyGWalker Python library")
# Display PyGWalker with the chart configuration exported from Jupyter
@st.cache_resource
def get_renderer(df):
return StreamlitRenderer(df, spec="./config.json", appearance="dark")
get_renderer(df).explorer()
st.cache_resource keeps one renderer per session, so the canvas does not rebuild on every rerun. In the video I passed the config file’s content to pyg.walk(df, env='Streamlit', dark='dark', spec=config); that call does not work with current versions, but the exported config file still loads.
Start the app with streamlit run app.py and the canvas works just like in the notebook. If you need a fixed dashboard with filters rather than an open canvas, see my Excel dashboard in Streamlit.

