Interactive Tables
Pandas DataFrames and Series as interactive datatables!
Documentation
Browse the documentation to see examples of Pandas datatables rendered as interactive datatables.
Quick start
Install the itables package with either
pip install itables
or
conda install itables -c conda-forge
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:
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:
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.
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 , 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
from itables.downsample import nbytes
import itables.options as opt
opt.lengthMenu = [2, 5, 10, 20, 50, 100, 200, 500]
opt.maxBytes = 10000
df = get_indicators()
nbytes(df)
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
Release files for itables 1.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| itables-1.3.5.tar.gz | 192.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| itables-1.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 388.2 kB
Release files / itables-1.3.5.tar.gz
| Download URL | itables-1.3.5.tar.gz |
|---|---|
| Size | 192.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d377fae8f44375dcb093a4ef6e9829c0a8b27539081bbf29f75536f14cc770db
|
|
BLAKE2b-256 checksum How to use checksums |
8fed3489d87d78c2bd2eaa2fda9d6a0afb46eb402e494a31ef21fc933074d7b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.15
|
Release files / itables-1.3.5-py3-none-any.whl
| Download URL | itables-1.3.5-py3-none-any.whl |
|---|---|
| Size | 195.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0d3206a04ebbd4ad73984ea4e5674de4c512284b008d2834208af8c9f6369ba
|
|
BLAKE2b-256 checksum How to use checksums |
077fe3d575365cdbf2f37ac37c6d2966366d470c2e36e7dccb767134bd12e83c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.15
|