Turn DataFrames into interactive, sortable, and searchable tables

Reading Time: 2 mins

DataFrames are an essential data structure for data scientists and the most popular format for exploring data in Python.

But presenting DataFrames to others can be lacklustre.

A static view of a few rows in a notebook isn’t a great way for anybody to view or interact with valuable analysis.

Introducing Interactive DataTables

Our dp.DataTable function renders an interactive, sortable, searchable table from a pd.DataFrame.

Lacklustre data is immediately transformed into something interactive that end-users can filter, export, and run SQL queries against.

In short, they can easily extract values and subsets of data without writing Python.

Why it's useful

dp.DataTable is a powerful tool for Jupyter users. 

It allows them to display and share data with non-technical viewers, who can explore it independently in a controlled environment.

The SQL functionality is almost a secret weapon. 

It's quick, it doesn't require re-execution of a (potentially long) pipeline, a (correct) development environment, or an understanding of the underlying data structure and Pandas.

Building a DataTable

To create a dp.DataTable, import the datapane library:

import datapane as dp

Next, take any DataFrame:

A Jupyter Notebook with a static DataFrame

and wrap it in Datapane's dp.DataTable block:

dp.DataTable(df)
A Jupyter Notebook with an interactive DataTable

Our DataFrame is now interactive. We can explore it with filters, sorting, export options, and even run SQL queries against the data.

You can automatically turn it into a data app using our automatic Jupyter conversion to save locally or upload to cloud.

We can even share the notebook itself, enabling end-users to explore our dataset.

Have a go, and let us know what you think.

Get great content updates from our team to your inbox.

Join 6,000 Data Scientist subscribers. GDPR compliant.