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: README.md
+23-14Lines changed: 23 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,6 @@ df
19
19
20
20
You don't see any table above? Please either open the [HTML export](https://mwouts.github.io/itables/) of this notebook, or run this README on [Binder](https://mybinder.org/v2/gh/mwouts/itables/master?filepath=README.md)!
But in some cases - a table with many column like the one below, we can use the `width` parameter...
131
+
For tables that are larger than the notebook, the `columnDefs` argument allows to specify the desired width. If you wish you can also change the default in `itables.options`.
@@ -169,22 +162,37 @@ Not currently implemented. May be made available at a later stage using the [sel
169
162
Not currently implemented. May be made available at a later stage thanks to the [buttons](https://datatables.net/extensions/buttons/) extension for datatable.
170
163
171
164
172
-
## Large table support
165
+
## Downsampling
173
166
174
-
`itables` will not display dataframes that are larger than `maxBytes`, which is equal to 1MB by default. Truncate the dataframe with `df.head()`, or set the `maxBytes` parameter or option to an other value to display the dataframe. Or deactivate the limit with `maxBytes=0`.
167
+
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')`).
175
168
176
169
Note that datatables support [server-side processing](https://datatables.net/examples/data_sources/server_side). At a later stage we may implement support for larger tables using this feature.
177
170
178
171
```python
179
-
df = wb.get_indicators()
172
+
df = wb.get_indicators().head(500)
173
+
opt.maxBytes =10000
180
174
df.values.nbytes
181
175
```
182
176
183
177
```python
184
-
opt.maxBytes =1000000
185
178
df
186
179
```
187
180
181
+
To show the table in full, we can modify the value of `maxBytes` either locally:
182
+
183
+
```python
184
+
show(df, maxBytes=0)
185
+
```
186
+
187
+
or globally:
188
+
189
+
```python
190
+
opt.maxBytes =2**20
191
+
df
192
+
```
193
+
194
+
The `maxRows` and `maxColumns` arguments work similarly.
195
+
188
196
# References
189
197
190
198
## DataTables
@@ -195,7 +203,8 @@ df
195
203
196
204
## Alternatives
197
205
198
-
ITables is not a Jupyter widget, which means that it does not allows you to **edit** the content of the dataframe.
206
+
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.
207
+
199
208
If you are looking for Jupyter widgets, have a look at
200
209
-[QGrid](https://github.com/quantopian/qgrid) by Quantopian
201
210
-[IPyaggrid](https://dgothrek.gitlab.io/ipyaggrid/) by Louis Raison and Olivier Borderies
0 commit comments