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

z31licg0  于 9个月前  发布在  Flink
关注(0)|答案(2)|浏览(84)

我尝试使用cufflinks绘制一个 Dataframe ,但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

我有plotly和袖扣安装如下:

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
ff29svar

ff29svar1#

我在这里找到了答案:https://nbviewer.org/gist/santosjorge/5fdbe947496faf7af5e6
我需要做的就是进入离线模式:

cf.set_config_file(offline=True)
ukqbszuj

ukqbszuj2#

通过添加下面两行它为我工作

import cufflinks as cf

cf.go_offline()
init_notebook_mode()

相关问题