最近在學習fbprophet時,按照安裝步驟,搭建好環境之后,使用官方教程進行學習。在執行到下面這句時報錯
fig = plot_plotly(m, forecast) # This returns a plotly Figure
具體報錯為:
NameError Traceback (most recent call last) <ipython-input-20-42c219cbc949> in <module> ----> 1 fig = plot_plotly(m, forecast) # This returns a plotly Figure ~/anaconda3/lib/python3.7/site-packages/fbprophet/plot.py in plot_plotly(m, fcst, uncertainty, plot_cap, trend, changepoints, changepoints_threshold, xlabel, ylabel, figsize) 566 data = [] 567 # Add actual --> 568 data.append(go.Scatter( 569 name='Actual', 570 x=m.history['ds'], NameError: name 'go' is not defined
解決方法:
如果已經安裝plotly,這里就不需要安裝了。
pip install plotly
pip install ipywidgets
轉載請注明:
微信公眾號:數據志
簡書:數據志