I am trying to reproduce the example of pivottable.js in jupyter notebook (here https://github.com/nicolaskruchten/jupyter_pivottablejs/tree/master/example) but I get an error :
Code (df is a pandas dataframe from a mps.csv in link above)
from pivottablejs import pivot_ui
pivot_ui(df,
cols= ["Party"],
rows= ["Province"],
rendererName= "Horizontal Stacked Bar Chart",
rowOrder= "value_z_to_a",
colOrder= "value_z_to_a",
rendererOptions= {
"c3": { "data": {"colors": {
"Liberal": '#dc3912', "Conservative": '#3366cc', "NDP": '#ff9900',
"Green":'#109618', 'Bloc Quebecois': '#990099'
}}}
}
)
Error
TypeError Traceback (most recent call last)
<ipython-input-10-accb72869b19> in <module>()
12 "c3": { "data": {"colors": {
13 "Liberal": '#dc3912', "Conservative": '#3366cc', "NDP": '#ff9900',
---> 14 "Green":'#109618', 'Bloc Quebecois': '#990099'
15 }}}
16 }
TypeError: pivot_ui() got an unexpected keyword argument 'cols'
TypeError: pivot_ui() got an unexpected keyword argument 'cols'
I tried using 'columns' instead of 'cols' and it did not work.
Thanks for your help!
Here a screenshot of the jupyter notebook screenshot