![](/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.