Interactive DataFrame Visualization in Jupyter Notebook with 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 Notebook, providing features such as pivoting, drag‑and‑drop filtering, visual exploration, and lightweight data inspection for enhanced data analysis.
Interactive DataFrame Visualization in Jupyter Notebook
Pandas is a common package for handling tabular data, but its DataFrame output is not always intuitive for data analysis. This article presents four Python packages that convert Pandas DataFrames into interactive tables, allowing direct manipulation and visualization within Jupyter Notebook.
Pivottablejs
Pivottablejs is a JavaScript library integrated into Python via IPython widgets, enabling users to create interactive and flexible pivot reports directly from DataFrame data. It facilitates efficient, clear data analysis and representation, turning DataFrames into easy‑to‑observe interactive pivot tables.
<code>!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)
</code>The function pivot_ui automatically generates an interactive UI, allowing users to modify aggregation items, inspect data structures, and quickly adjust the layout.
In the notebook, you can filter the DataFrame and generate charts directly.
You can also quickly generate pivot tables.
PyGWalker
PyGWalker converts a DataFrame into a table‑style UI, offering an intuitive and efficient way to explore data. Its interface feels familiar to Tableau users, making the learning curve shallow for those with Tableau experience.
<code>!pip install pygwalker
import pygwalker as pyw
walker = pyw.walk(data)
</code>Simple drag‑and‑drop actions enable filtering and visualization, providing a very convenient workflow.
Qgrid
Qgrid is another excellent tool that easily transforms a DataFrame into a visually intuitive interactive data table.
<code>import qgrid
qgridframe = qgrid.show_grid(data, show_toolbar=True)
qgridframe
</code>It also allows adding and deleting rows directly on the table.
Itables
Similar to Qgrid, Itables provides a simple interface for filtering, searching, and sorting.
<code>from itables import init_notebook_mode, show
init_notebook_mode(all_interactive=False)
show(data)
</code>While tables and Qgrid are lightweight for quick data inspection, more complex insights benefit from using Pivottablejs and PyGWalker.
Conclusion
The packages above enable conversion of DataFrames into interactive tables within Jupyter Notebook. Itables and Qgrid are lightweight for rapid data viewing, whereas Pivottablejs and PyGWalker offer richer interaction 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.