![](/img/trans.png)
[英]Remove the “This is the format of your plot grid:” in a plotly subplot in a Jupyter Notebook
[英]The plotly.grid_objs module is deprecated for jupyter notebook offline plot
我正在关注plotly官方网站上的教程。 我正在使用 jupyter 笔记本。 我收到 plot.grid_objs 的导入错误。 我正在使用 plotly 4.0。 有什么建议可以解决吗? 谢谢
https://plotly.com/python/v3/gapminder-example/
ImportError: plotly.grid_objs 模块已弃用,请安装 chart-studio package 并改用 chart_studio.grid_objs 模块
import plotly as py
import plotly.figure_factory as FF
from plotly.grid_objs import Grid, Column
import pandas as pd
import time
import pickle
filename_pickle='dataset.pkl'
try:
dataset=pd.read_pickle(filename_pickle)
except FileNotFoundError:
url = 'https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv'
dataset = pd.read_csv(url)
dataset.to_pickle(filename_pickle)
table = FF.create_table(dataset.head(10))
py.offline.iplot(table) # table is inline inside jupyter notebook
ImportError:
The plotly.grid_objs module is deprecated,
please install the chart-studio package and use the
chart_studio.grid_objs module instead
看起来本教程适用于更旧版本的 plotly。 尝试:
pip install plotly==2.0.1
在您的终端中,然后重新运行 Python 代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.