Skip to main content

Interactive Tables in Jupyter

Project description

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)

or use itables.show to show just one Series or DataFrame as an interactive table.

(NB: In Jupyter Notebook, Jupyter NBconvert and Jupyter Book, you need to call init_notebook_mode() before using show).

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)
  • Or you are offline?

At the moment itables does not have an offline mode. While the table data is embedded in the notebook, the jquery and datatables.net are loaded from a CDN, see our require.config and our table template, so an internet connection is required to display the tables.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itables-0.4.6.tar.gz (40.7 kB view details)

Uploaded Source

Built Distribution

itables-0.4.6-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file itables-0.4.6.tar.gz.

File metadata

  • Download URL: itables-0.4.6.tar.gz
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.13

File hashes

Hashes for itables-0.4.6.tar.gz
Algorithm Hash digest
SHA256 5e22f17981d1f1add0aa2c80f9acc2e4ed79ed7b911af81bf9ec54d61eda01c9
MD5 b1e9bed83ee0ae3b535976f10d7e5fbc
BLAKE2b-256 63c6f3424232c0a71e2c195fa3a0a29ccf4537bae10692e76dade701c2feda6c

See more details on using hashes here.

File details

Details for the file itables-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: itables-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 41.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.13

File hashes

Hashes for itables-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e1e1b274e9ce36c145194e21a577f49f0a1ad659b7dc69460d3cfdc949c14cb4
MD5 f857ec725793c1d1441e752f24229cb6
BLAKE2b-256 77c16f8cd212c687d500e0dd350436523b347bb007d179d99faa4928d15bd45c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page