Skip to content

Commit 67a351a

Browse files
authored
Version 0.4.0 (#44)
* Version 0.4.0
1 parent 99fe098 commit 67a351a

File tree

3 files changed

+18
-28
lines changed

3 files changed

+18
-28
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
0.4.0 (2022-01-??)
1+
0.4.0 (2022-01-06)
22
==================
33

44
Changed
55
-------
6-
- We load the `datatables.net` library with an ES import when `require.js` is not available. Now `itables` should also work in Jupyter Lab, VS Code and Colab (#3, #40)
6+
- Now `itables` also works in Jupyter Lab, Colab, Nteract, VS Code and PyCharm (#3, #4, #26, #40), as we load the `datatables.net` library with an ES import when `require.js` is not available. Many thanks to [François Wouts](https://github.com/fwouts) for his precious help!
77
- The `show` function (and `itables.options`) has a new argument `eval_functions`. When set to `True`, the nested strings passed to `datatables.net` that start with `function` are converted to Javascript functions.
88
- The HTML code for the datatables.net representation of the table is generated with an HTML template.
99
- We use f-strings and thus require Python >= 3.6

README.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Pandas DataFrames and Series as Interactive Tables in Jupyter
1+
# Pandas DataFrames and Series as Interactive Tables
22

33
[![Pypi](https://img.shields.io/pypi/v/itables.svg)](https://pypi.python.org/pypi/itables)
44
![CI](https://github.com/mwouts/itables/workflows/CI/badge.svg)
@@ -9,7 +9,7 @@
99
[![Lab](https://img.shields.io/badge/Binder-JupyterLab-blue.svg)](https://mybinder.org/v2/gh/mwouts/itables/main?urlpath=lab/tree/README.md)
1010
<a class="github-button" href="https://github.com/mwouts/itables" data-icon="octicon-star" data-show-count="true" aria-label="Star mwouts/itables on GitHub">Star</a>
1111

12-
Turn pandas DataFrames and Series into interactive [datatables](https://datatables.net) in both your notebooks and their HTML representation with `import itables.interactive`:
12+
Turn pandas DataFrames and Series into interactive [datatables](https://datatables.net) in your notebooks with `import itables.interactive`:
1313

1414
![](https://raw.githubusercontent.com/mwouts/itables/main/demo/itables.gif)
1515

@@ -21,22 +21,6 @@ Install the package with
2121
pip install itables
2222
```
2323

24-
In Jupyter Lab, load the `require` Javascript library (this is not required in Jupyter Notebook):
25-
26-
```python
27-
# This is required only in Jupyter Lab - don't do this in Jupyter Notebook
28-
# A PR is welcome if you know how to avoid this.
29-
# See https://github.com/mwouts/itables/issues/3
30-
from IPython.display import HTML, display
31-
from time import sleep
32-
33-
display(HTML("""
34-
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
35-
"""))
36-
37-
sleep(0.1)
38-
```
39-
4024
Activate the interactive mode for all series and dataframes with
4125

4226
```python
@@ -63,6 +47,17 @@ x = wb.get_series("SP.POP.TOTL", mrv=1, simplify_index=True)
6347
show(x)
6448
```
6549

50+
# Supported environments
51+
52+
`itables` has been tested in the following editors:
53+
- Jupyter Notebook
54+
- Jupyter Lab
55+
- Jupyter nbconvert (i.e. the tables are still interactive in the HTML export of a notebook)
56+
- Google Colab
57+
- VS Code (for both Jupyter Notebooks and Python scripts)
58+
- PyCharm (for Jupyter Notebooks)
59+
- Nteract
60+
6661
# Advanced usage
6762

6863
## Row sorting
@@ -253,11 +248,10 @@ df
253248

254249
- DataTables is a plug-in for the jQuery Javascript library. It has a great [documentation](https://datatables.net/manual/), and a large set of [examples](https://datatables.net/examples/index).
255250
- The R package [DT](https://rstudio.github.io/DT/) uses [datatables.net](https://datatables.net/) as the underlying library for both R notebooks and Shiny applications. In addition to the standard functionalities of the library (display, sort, filtering and row selection), RStudio seems to have implemented cell edition.
256-
- Marek Cermak has an interesting [tutorial](https://medium.com/@marekermk/guide-to-interactive-pandas-dataframe-representation-485acae02946) on how to use datatables within Jupyter. He also published [jupyter-datatables](https://github.com/CermakM/jupyter-datatables), with a focus on numerical data and distribution plots.
257251

258252
## Alternatives
259253

260-
ITables uses basic Javascript, and because of this it will only work in Jupyter Notebook, not in JupyterLab. It is not a Jupyter widget, which means that it does not allows you to **edit** the content of the dataframe.
254+
ITables uses basic Javascript. It is not a Jupyter widget, which means that it does not allows you to **edit** the content of the dataframe.
261255

262256
If you are looking for Jupyter widgets, have a look at
263257
- [QGrid](https://github.com/quantopian/qgrid) by Quantopian
@@ -266,10 +260,6 @@ If you are looking for Jupyter widgets, have a look at
266260

267261
If you are looking for a table component that will fit in Dash applications, see [datatable by Dash](https://github.com/plotly/dash-table/).
268262

269-
## Contributing
270-
271-
I think it would be very helpful to have an identical table component for both Jupyter and [Dash](http://dash.plot.ly/). Please [let us know](https://community.plot.ly/t/why-does-dash-have-its-own-datatable-library/) if you are interested in drafting a new table component based on an existing Javascript library for Dash.
272-
273-
Also, if you happen to prefer another Javascript table library (say, [ag-grid](https://www.ag-grid.com/)), and you would like to see it supported in `itables`, please open either an issue or a PR, and let us know what is the minimal code to display a table in Jupyter using your library.
263+
Please also checkout [D-Tale](https://github.com/man-group/dtale) for exploring your Python DataFrames in the browser, using a local server.
274264

275265
<script async defer src="https://buttons.github.io/buttons.js"></script>

itables/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""ITables' version number"""
22

3-
__version__ = "0.4.0-dev"
3+
__version__ = "0.4.0"

0 commit comments

Comments
 (0)