pivottablejs 在 jupyter 笔记本中不显示任何结果

问题描述 投票:0回答:1

pivottablejs 在 jupyter 笔记本中不显示任何结果。单击超链接(弹出),显示一个空白页面。

from pivottablejs import pivot_ui
from IPython.display import IFrame
from IPython.core.display import display

import pandas as pd
df = pd.read_csv('sample.csv',encoding='utf-8')

python pandas jupyter-notebook data-visualization pivottable.js
1个回答
2
投票

请参阅对我有用的解决方案(位于 https://github.com/nicolaskruchten/pivottable/issues/1269)。

嗨,我没有找到在 vscode 上使用数据透视表的解决方法。但是,如果 您打开在您的文件夹中生成的pivottablejs.html 网页浏览器就可以正常使用了。

这是我的有效代码。首先,我定义了路径并保存了一个 HTML 文件。然后我在chrome中打开这个html文件,效果很好。

#!pip install pivottablejs
from pivottablejs import pivot_ui
pivot_ui(df, outfile_path=r"D:\XXXXXX\pivot.html")
© www.soinside.com 2019 - 2024. All rights reserved.