You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apps/notebook.md
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,12 @@ kernelspec:
12
12
name: itables
13
13
---
14
14
15
+
```{code-cell} ipython3
16
+
:tags: [remove-cell]
17
+
18
+
# pyright: reportUnusedExpression=false
19
+
```
20
+
15
21
# Notebook Mode
16
22
17
23
Activate ITables in a Jupyter environment for all your tables with `init_notebook_mode`:
@@ -24,6 +30,13 @@ itables.init_notebook_mode()
24
30
25
31
You can go back to the standard HTML representation of Pandas DataFrames with `init_notebook_mode(all_interactive=False)`.
26
32
33
+
```{code-cell} ipython3
34
+
:tags: [full-width]
35
+
36
+
df = itables.sample_dfs.get_countries(html=False)
37
+
df
38
+
```
39
+
27
40
Note that the `init_connected_mode` function also activates ITable's offline mode, unless you call it with a `connected=False` argument.
28
41
29
42
@@ -42,15 +55,7 @@ about [700kB](https://github.com/mwouts/itables/blob/main/tests/test_connected_n
42
55
If you prefer to render only certain tables using `itables`, or want to set additional options, use `show`:
43
56
44
57
```{code-cell} ipython3
45
-
df = itables.sample_dfs.get_countries(html=False)
58
+
:tags: [full-width]
46
59
47
-
itables.show(
48
-
df,
49
-
caption="A DataFrame rendered with ITables",
50
-
lengthMenu=[2, 5, 10, 25, 50, 100, 250],
51
-
)
60
+
itables.show(df, caption="A DataFrame rendered with ITables")
52
61
```
53
-
54
-
## HTML
55
-
56
-
The `show` function simply displays the HTML snippet for the table, which is obtained with `to_html_datatable`. See more in the section on [HTML export](html.md).
Copy file name to clipboardExpand all lines: docs/downsampling.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,13 @@ kernelspec:
20
20
21
21
# Downsampling
22
22
23
-
When an interactive table is displayed by `itables`, the table data is embedded in the notebook output. As we don't want your notebook to become super heavy just because you displayed a large table, we have a downsampling mechanism in place.
23
+
When an interactive table is displayed by `itables`, the table data is embedded into the notebook itself. Large tables need to be downsampled, otherwise your notebook will become huge and irresponsive.
24
24
25
-
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`, and display a warning that points to the `itables` documentation.
25
+
Downsampling occurs when the table data is larger than `maxBytes`, which is equal to 64KB by default. When downsampling occurs, a warning is displayed below the table, which points to the `itables` documentation.
26
26
27
-
If you wish, you can increase the value of `maxBytes` or even deactivate the limit (with `maxBytes=0`). Similarly, you can set a limit on the number of rows (`maxRows`, defaults to 0) or columns (`maxColumns`, defaults to `200`).
27
+
If you wish, you can increase the value of `maxBytes` or even deactivate the limit (with `maxBytes=0`) - but again, that will break your notebook when you display a large dataframe.
28
+
29
+
Similarly, you can set a limit on the number of rows (`maxRows`, defaults to 0) or columns (`maxColumns`, defaults to `200`).
Copy file name to clipboardExpand all lines: docs/py/apps/notebook.py
+11-14Lines changed: 11 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@
14
14
# name: itables
15
15
# ---
16
16
17
+
# %% tags=["remove-cell"]
18
+
# pyright: reportUnusedExpression=false
19
+
17
20
# %% [markdown]
18
21
# # Notebook Mode
19
22
#
@@ -26,7 +29,12 @@
26
29
27
30
# %% [markdown]
28
31
# You can go back to the standard HTML representation of Pandas DataFrames with `init_notebook_mode(all_interactive=False)`.
29
-
#
32
+
33
+
# %% tags=["full-width"]
34
+
df=itables.sample_dfs.get_countries(html=False)
35
+
df
36
+
37
+
# %% [markdown]
30
38
# Note that the `init_connected_mode` function also activates ITable's offline mode, unless you call it with a `connected=False` argument.
31
39
#
32
40
#
@@ -44,16 +52,5 @@
44
52
#
45
53
# If you prefer to render only certain tables using `itables`, or want to set additional options, use `show`:
46
54
47
-
# %%
48
-
df=itables.sample_dfs.get_countries(html=False)
49
-
50
-
itables.show(
51
-
df,
52
-
caption="A DataFrame rendered with ITables",
53
-
lengthMenu=[2, 5, 10, 25, 50, 100, 250],
54
-
)
55
-
56
-
# %% [markdown]
57
-
# ## HTML
58
-
#
59
-
# The `show` function simply displays the HTML snippet for the table, which is obtained with `to_html_datatable`. See more in the section on [HTML export](html.md).
55
+
# %% tags=["full-width"]
56
+
itables.show(df, caption="A DataFrame rendered with ITables")
Copy file name to clipboardExpand all lines: docs/py/downsampling.py
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -20,22 +20,23 @@
20
20
# %% [markdown]
21
21
# # Downsampling
22
22
#
23
-
# When an interactive table is displayed by `itables`, the table data is embedded in the notebook output. As we don't want your notebook to become super heavy just because you displayed a large table, we have a downsampling mechanism in place.
23
+
# When an interactive table is displayed by `itables`, the table data is embedded into the notebook itself. Large tables need to be downsampled, otherwise your notebook will become huge and irresponsive.
24
24
#
25
-
# 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`, and display a warning that points to the `itables` documentation.
25
+
# Downsampling occurs when the table data is larger than `maxBytes`, which is equal to 64KB by default. When downsampling occurs, a warning is displayed below the table, which points to the `itables` documentation.
26
26
#
27
-
# If you wish, you can increase the value of `maxBytes` or even deactivate the limit (with `maxBytes=0`). Similarly, you can set a limit on the number of rows (`maxRows`, defaults to 0) or columns (`maxColumns`, defaults to `200`).
27
+
# If you wish, you can increase the value of `maxBytes` or even deactivate the limit (with `maxBytes=0`) - but again, that will break your notebook when you display a large dataframe.
28
+
#
29
+
# Similarly, you can set a limit on the number of rows (`maxRows`, defaults to 0) or columns (`maxColumns`, defaults to `200`).
0 commit comments