PyGWalker Jupyter API Guide
This guide explains how to use PyGWalker in Jupyter notebooks, covering the main functions and their parameters.
Main Functions
1. walk()
Creates an interactive GraphicWalker instance.
import pygwalker as pyg
walker = pyg.walk(dataset)
2. render()
Renders a specific chart configuration.
import pygwalker as pyg
walker = pyg.render(dataset, spec="./gw_config.json")
3. table()
Displays the dataset as an interactive table.
import pygwalker as pyg
walker = pyg.table(dataset)
Common Parameters
Parameter | Type | Default | Description |
---|---|---|---|
dataset | Union[DataFrame, Connector] | - | Input data. See Dataset Of Walker for details. |
gid | Union[int, str] | None | GraphicWalker container div ID. Format: 'gwalker-{gid}'. Auto-generated if None. |
field_specs | Optional[Dict[str, FieldSpec]] | None | Field specifications. Auto-inferred if not specified. |
theme_key | Literal['vega', 'g2'] | 'g2' | Theme type for GraphicWalker. |
appearance | Literal['media', 'light', 'dark'] | 'media' | Theme setting. 'media' auto-detects OS theme. |
spec | str | "" | Chart configuration data (ID, JSON, or URL). |
kernel_computation | bool | None | Enables high-performance kernel computation for larger datasets. |
kanaries_api_key | str | "" | Kanaries API key. |
default_tab | Literal["data", "vis"] | "vis" | Default tab to show (only for walk() ). |
cloud_computation | bool | False | Enables cloud computation (uploads data to Kanaries cloud). |
Best Practices and Tips
-
Large Datasets: For CSV files > 1GB, use
kernel_computation=True
to enable high-performance processing. -
Theming:
- Set theme with
appearance='light'
orappearance='dark'
. - If PyGWalker's theme doesn't match Jupyter's, explicitly set the appearance.
- Set theme with
-
Saving Charts:
- Save to a file or export as code.
- Detailed guide on saving and sharing (opens in a new tab)
-
Performance: Use
kernel_computation=True
for larger datasets to leverage the internal DuckDB-based engine. -
Cloud Computation: Set
cloud_computation=True
to use Kanaries cloud for data processing (requires API key).
Examples
- Kaggle Demo: Airbnb EDA with PyGWalker (opens in a new tab)
- GitHub: Jupyter Notebook Demo (opens in a new tab)
For more advanced usage and integration examples, please refer to the PyGWalker documentation (opens in a new tab).
Related Q&A
My pygwalker cannot handle CSV > 1GB, what should I do?
PyGWalker has a internal engine based on DuckDB which allows you to handle much larger dataset with high performance. You can enable it with kernel_computation=True
parameter.
How to set pygwalker's theme (light or dark)?
You can set the theme with appearance
parameter. Available values: dark
| light
| media
. Default by media
which will be automatically switched by the system.
Why my pygwalker is dark but my juypter is light?
pygwalker follows the system theme by default. But some juypters cannot follow the system theme.
You can set the theme with appearance='light'
to make pygwalker to use light theme.
How to save the charts of pygwalker in juypter?
There is two ways to save pygwalker's charts and state. Save it into a file or export as code. More details (opens in a new tab)