cufflinks 'df.iplot()' 不适用于 vscode/jupyter



我正试图使用袖扣绘制数据帧,但df.iplot()不起作用——它在10秒后不会返回。我正在从vscode+jupyter扩展运行。plotly运行良好。关于我做错了什么,有什么建议吗?

import cufflinks as cf
cf.set_config_file(world_readable=True,theme='pearl')
df = cf.datagen.lines()
df.head()
# LLZ.LP    UPU.PN  PTJ.OF  ZIM.KK  ESA.OS
# 2015-01-01    0.911   -1.508  -1.818  0.900   -1.100
# 2015-01-02    0.123   -0.109  -2.074  0.731   -0.951
# 2015-01-03    0.389   0.794   -1.999  -1.705  -1.930
# 2015-01-04    -0.398  0.374   -2.358  -0.746  -2.740
# 2015-01-05    -0.828  -0.256  -2.572  0.362   -0.980

df.iplot() # does not return

我有阴谋和袖扣安装如下:

conda install -c plotly plotly=5.10.0 
conda install "notebook>=5.3" "ipywidgets>=7.5" 
conda install -c conda-forge cufflinks-py
# conda list | grep -e plotly -e cufflinks
# cufflinks-py              0.17.3                     py_0    conda-forge
# plotly                    5.10.0                     py_0    plotly
# python-cufflinks          0.17.3                     py_0    conda-forge

我在这里找到了答案:https://nbviewer.org/gist/santosjorge/5fdbe947496faf7af5e6

我所需要做的就是进入离线模式:

cf.set_config_file(offline=True)

通过在下面添加两行,它对我的有效

import cufflinks as cf
cf.go_offline()
init_notebook_mode()

相关内容

最新更新