Skip to content
PYGWALKER
API Reference
Use in Jupyter

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

ParameterTypeDefaultDescription
datasetUnion[DataFrame, Connector]-Input data. See Dataset Of Walker for details.
gidUnion[int, str]NoneGraphicWalker container div ID. Format: 'gwalker-{gid}'. Auto-generated if None.
field_specsOptional[Dict[str, FieldSpec]]NoneField specifications. Auto-inferred if not specified.
theme_keyLiteral['vega', 'g2']'g2'Theme type for GraphicWalker.
appearanceLiteral['media', 'light', 'dark']'media'Theme setting. 'media' auto-detects OS theme.
specstr""Chart configuration data (ID, JSON, or URL).
kernel_computationboolNoneEnables high-performance kernel computation for larger datasets.
kanaries_api_keystr""Kanaries API key.
default_tabLiteral["data", "vis"]"vis"Default tab to show (only for walk()).
cloud_computationboolFalseEnables cloud computation (uploads data to Kanaries cloud).

Best Practices and Tips

  1. Large Datasets: For CSV files > 1GB, use kernel_computation=True to enable high-performance processing.

  2. Theming:

    • Set theme with appearance='light' or appearance='dark'.
    • If PyGWalker's theme doesn't match Jupyter's, explicitly set the appearance.
  3. Saving Charts:

  4. Performance: Use kernel_computation=True for larger datasets to leverage the internal DuckDB-based engine.

  5. Cloud Computation: Set cloud_computation=True to use Kanaries cloud for data processing (requires API key).

Examples

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)