NameError: name 'go' is not defined

最近在学习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


 

转载请注明:

微信公众号:数据志

简书:数据志

博客园:https://www.cnblogs.com/wheng/

CSDN:https://blog.csdn.net/wzgl__wh

猜你喜欢

转载自www.cnblogs.com/wheng/p/12398866.html