Skip to content
Tutorials
Best Practices for Using Pygwalker in Kaggle

Best Practices for Using Pygwalker in Kaggle

Pygwalker>=0.3.17

In the Kaggle notebook, it is quite painful to have two different sessions reading and writing to the same file.

In the past, users import Pygwalker to generate their charts in Kaggle. When users saved their notebooks, they found that their charts disappeared. This is because Pygwalker requires a file to save the user's chart configurations, and performing this operation smoothly in Kaggle is not possible.

Below, three methods are introduced to save Pygwalker charts in a Kaggle notebook.


Use Kanaries Cloud File(Highly Recommended)

Demo Code

walker = pyg.walk(df, spec="ksf://<your_workspace_name>/<your_file_name>")

Click Save Icon To Save Your Conifg

image

Click the save icon to save your chart configurations. If the save is successful, all the charts you created using Pygwalker will be displayed when you save the notebook.

How To Get Kanaries Api Key

refer it: How to get api key of kanaries? (opens in a new tab)

How To Set Kanaries Api Key In Kaggle

isvCEgh3PZ

img_v3_025l_0a0b71ad-807c-42de-9447-0f23b074302g


Use Export Code Tool In Pygwalker

1. Click Export Code Icon

image

2. Copy Code

image

3. Paste the code, run it, and then you can save your notebook.

Use Quick Save In Kaggle

Fx6ffUoDGB