Use PyGWalker in Kaggle Notebooks
PyGWalker is a great tool using in juypter notebook or juypter lab. But Kaggle notebooks has some limitions and different you need to know. This article will show you how to use PyGWalker in Kaggle notebooks.
Kaggle environment does not have pygwalker installed by default. You need to install it first. In kaggle, you can install it in notebook directly.
!pip install pygwalker import pygwalker as pyg
Install a python may bring lots of console output. You can use
!pip install pygwalker -q to hide the output.
# recommend install pygwalker in quiet mode !pip install pygwalker import pygwalker as pyg
For basic usage, which turns your dataframe into interactive data app, you can use it as usual.
# load data df = pyg.load_data('data.csv') pyg.walk(df)
If you do not know how to save the charts you made in pygwalker in juypter notebook, check this tutorial fitst.
Now we are facing some differences between kaggle and juypter notebook/lab. Usually, when we enable
use_preview=True, we can share the notebook with others which all visualization we made in pygwalker can directly shown even you do not start the notebook kernel.
But in kaggle, we need to set
Save outputin Advanced Settings to be
Always save output when creating a quick save.
Kaggle do not support share files in your output file, so you have to move the file to your input directory and then read it from there.