Interactive DataFrames in Jupyter: Using Pivottablejs, PyGWalker, Qgrid, and Itables
This article introduces four Python packages—Pivottablejs, PyGWalker, Qgrid, and Itables—that transform Pandas DataFrames into interactive tables within Jupyter notebooks, providing code examples, visual demonstrations, and guidance on when to choose each tool for data analysis and visualization.
Pandas is a widely used library for handling tabular data, but its DataFrame can be unintuitive for interactive analysis. This article presents four Python packages that convert Pandas DataFrames into interactive tables, enabling direct data exploration, filtering, and visualization inside Jupyter notebooks.
Pivottablejs
Pivottablejs is a JavaScript library integrated into Python via IPython widgets, allowing users to create interactive pivot tables directly from a DataFrame. The pivot_ui function generates a UI where users can modify aggregations and restructure data on the fly.
!pip install pivottablejs
from pivottablejs import pivot_ui
import pandas as pd
data = pd.read_csv("D:\Data\company_unicorn.csv")
data["Year"] = pd.to_datetime(data["Date Joined"]).dt.year
pivot_ui(data)In the notebook, the generated interface lets you filter data, create charts, and quickly produce pivot tables.
PyGWalker
PyGWalker turns a DataFrame into a Tableau‑like UI, offering an intuitive way to explore data. Users familiar with Tableau will find the interface easy to adopt.
!pip install pygwalker
import pygwalker as pyw
walker = pyw.walk(data)With simple drag‑and‑drop actions, you can filter, sort, and visualize data directly within the notebook.
Qgrid
Qgrid provides a lightweight, interactive grid for DataFrames, allowing visual inspection and editing of data.
import qgrid
qgridframe = qgrid.show_grid(data, show_toolbar=True)
qgridframeThe grid supports adding or deleting rows and offers basic filtering capabilities.
Itables
Itables offers a straightforward interface for displaying DataFrames with features such as filtering, searching, and sorting.
from itables import init_notebook_mode, show
init_notebook_mode(all_interactive=False)
show(data)While Itables and Qgrid are useful for quick data inspection, Pivottablejs and PyGWalker provide richer interactivity and visualization options for deeper analysis.
Conclusion
The presented packages enable conversion of DataFrames into interactive tables within Jupyter Notebook. Itables and Qgrid are lightweight for fast data checks, whereas Pivottablejs and PyGWalker are better suited for more advanced operations and simple visualizations.
Python Programming Learning Circle
A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.