Skip to main content

Interactive Tables

Pypi CI codecov.io Language grade: Python Code style: black

Pandas DataFrames and Series as interactive datatables!

Install the package with

pip install itables

Activate the interactive mode for all series and dataframes with

from itables import init_notebook_mode

init_notebook_mode(all_interactive=True)

and then render any Pandas DataFrame as an interactive table that you can sort, search and explore: df

If you prefer to render only selected DataFrames as interactive tables, use itables.show to show just one Series or DataFrame as an interactive table: show

Since itables==1.0.0, the jquery and datatables.net libraries and CSS are injected in the notebook when you execute init_notebook_mode with its default argument connected=False. Thanks to this the interactive tables will work even without a connection to the internet.

If you prefer to load the libraries dynamically (and keep the notebook lighter), use connected=True when you execute init_notebook_mode.

Documentation

Read more about itables and advanced use cases in the documentation.

In particular, the show method let you pass custom parameters to datatables.net's DataTable()'s constructor - see the advanced parameters examples.

Supported environments

itables has been tested in the following editors:

  • Jupyter Notebook
  • Jupyter Lab
  • Jupyter nbconvert (i.e. the tables are still interactive in the HTML export of a notebook)
  • Jupyter Book
  • Google Colab
  • VS Code (for both Jupyter Notebooks and Python scripts)
  • PyCharm (for Jupyter Notebooks)

Try ITables on Binder

You can run our examples notebooks directly on Lab, without having to install anything on your side.

Table not loading?

If the table just says "Loading...", then maybe

  • You loaded a notebook that is not trusted (run "Trust Notebook" in View / Activate Command Palette)
  • You forgot to run init_notebook_mode, or you deleted that cell or its output
  • Or you ran init_notebook_mode(connected=True) but you are not connected to the internet?

Please note that if you change the value of the connected argument in the init_notebook_mode cell, you will need to re-execute all the cells that display interactive tables.

If the above does not help, please check out the ChangeLog and decide whether you should upgrade itables.

Downsampling

When the data in a table is larger than maxBytes, which is equal to 64KB by default, itables will display only a subset of the table - one that fits into maxBytes. If you wish, you can deactivate the limit with maxBytes=0, change the value of maxBytes, or similarly set a limit on the number of rows (maxRows, defaults to 0) or columns (maxColumns, defaults to pd.get_option('display.max_columns')).

Note that datatables support server-side processing. At a later stage we may implement support for larger tables using this feature.

from itables.sample_dfs import get_indicators
import itables.options as opt

opt.lengthMenu = [2, 5, 10, 20, 50, 100, 200, 500]
opt.maxBytes = 10000

df = get_indicators()
df.values.nbytes
df

To show the table in full, we can modify the value of maxBytes either locally:

show(df, maxBytes=0)

or globally:

opt.maxBytes = 2 ** 20
df

Metadata

Release files for itables 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for itables 1.3.0
File Size Uploaded Provenance Actions
itables-1.3.0.tar.gz 191.2 kB Without provenance Details for itables-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for itables 1.3.0
File Interpreter ABI Platform Actions
itables-1.3.0-py3-none-any.whl Python 3 none any Details for itables-1.3.0-py3-none-any.whl

Total release size: 384.8 kB

Release files / itables-1.3.0.tar.gz

Download URL itables-1.3.0.tar.gz
Size 191.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3f5188d435e82a5e730265974f5dd735fe219ab6e226a609e6b57acd97609587
BLAKE2b-256 checksum
How to use checksums
cc013edd3fa40cfe81e3173efe877b7f5140e74c503170a1438f5e1570b2650d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release files / itables-1.3.0-py3-none-any.whl

Download URL itables-1.3.0-py3-none-any.whl
Size 193.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bf738e59b48d5d74d9a226b967e34f2889efe7cb04d9ff3fe03af87d8f26ca5
BLAKE2b-256 checksum
How to use checksums
476521cf62d03438e0686b0fcefbc69c2a50dee1910c281f33da32bbe59499d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Security for itables 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page