Interactive Tables
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 , 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
Metadata
Release files for itables 0.4.7
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-0.4.7.tar.gz | 40.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| itables-0.4.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.5 kB
Release files / itables-0.4.7.tar.gz
| Download URL | itables-0.4.7.tar.gz |
|---|---|
| Size | 40.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b74e4090ebd9dfb5d44b1e040d835f9162f593aff11b4b82d3ac43f3a2c754ea
|
|
BLAKE2b-256 checksum How to use checksums |
116f5eaa5df723575f7e12fa755e671098fd2675ff59b3e8af3fe9450bf8d8e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.13
|
Release files / itables-0.4.7-py3-none-any.whl
| Download URL | itables-0.4.7-py3-none-any.whl |
|---|---|
| Size | 41.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2fae007f1e22509832a9921832c33c8acb602a1de515727e8172c9a5a69dee0
|
|
BLAKE2b-256 checksum How to use checksums |
1ce5472b122d8adb6ccc2c49a34a7e9a51f1192bc15e09469418ad89780be4a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.13
|