forked from nicolaskruchten/jupyter_pivottablejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.rst
60 lines (38 loc) · 1.92 KB
/
README.rst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
``pivottablejs``: the Python module
===================================
Drag’n’drop Pivot Tables and Charts for `Jupyter/IPython Notebook`_,
care of `PivotTable.js`_
.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/nicolaskruchten/jupyter_pivottablejs/master?filepath=example%2Fjupyter_pivottablejs_example.ipynb
Installation
------------
``pip install pivottablejs`` or ``conda install pivottablejs``
**Note** in the past, the ``conda`` command above installed `pivottablejs-airgap`_ instead of this library; apologies for any confusion this change may cause.
Usage
-----
.. code:: python
import pandas as pd
df = pd.read_csv("some_input.csv")
from pivottablejs import pivot_ui
pivot_ui(df)
Advanced Usage
--------------
Include any `JSON-serializable option to PivotTable.js's pivotUI() function`_ as a keyword argument.
.. code:: python
pivot_ui(df, rows=['row_name'], cols=['col_name'])
Independently control the output file path and the URL used to access it from Jupyter, in case the default relative-URL behaviour is incompatible with Jupyter's settings.
.. code:: python
pivot_ui(df, outfile_path="/x/y.html", url="http://localhost/a/b/x.html")
.. _Jupyter/IPython Notebook: http://jupyter.org/
.. _PivotTable.js: https://github.com/nicolaskruchten/pivottable
.. _pivottablejs-airgap: https://github.com/ContinuumIO/pivottablejs-airgap
=======
.. _option to PivotTable.js's pivotUI() function: https://github.com/nicolaskruchten/pivottable/wiki/Parameters#options-object-for-pivotui
FORK Additions
--------------
Allow for custom *title* on the output html file
=======
Allow for custom `Title`
.. code:: python
pivot_ui(df, outfile_path="/x/y.html", url="http://localhost/a/b/x.html", title="Custom Title Here")
.. _JSON-serializable option to PivotTable.js's pivotUI() function: https://github.com/nicolaskruchten/pivottable/wiki/Parameters#options-object-for-pivotui