无法使用plotly打印。(Python金融食谱)

无法使用plotly打印。(Python金融食谱),python,pandas,plotly,finance,Python,Pandas,Plotly,Finance,我收到错误:PlotlyRequestError:未提供身份验证凭据。我编写了一个财务绘图库,它可以完成您正在寻找的功能: import pandas as pd import yfinance as yf import cufflinks as cf from plotly.offline import iplot, init_notebook_mode df = yf.download('SPY',start='2019-01-01', end = '2020-04-20') init_

我收到错误:PlotlyRequestError:未提供身份验证凭据。

我编写了一个财务绘图库,它可以完成您正在寻找的功能:

import pandas as pd
import yfinance as yf
import cufflinks as cf
from plotly.offline import iplot, init_notebook_mode

df = yf.download('SPY',start='2019-01-01', end = '2020-04-20')

init_notebook_mode()
qf = cf.QuantFig(df, title='SPY Price', legend='top', name='SPY')
qf.add_volume()
qf.add_sma(periods=20, column='Close', color='red')
qf.add_ema(periods=20, color='green')

qf.iplot()

它经过优化,我经常用它来绘制50万根或更多的蜡烛棒。祝你好运

尽量减少代码示例以重现此错误。看起来Plotly API需要一些证书刚刚偶然发现了这一点。它在Jupyter笔记本中工作吗?当我运行上面的脚本时,什么都没有发生。我注意到在github页面上您提到“它不适用于Jupyter实验室”。。。这是否也意味着jupyter笔记本电脑?@SCool:是的,它没有网络支持。
import yfinance as yf
import finplot as fplt

df = yf.download('SPY',start='2019-01-01', end = '2020-04-20')

fplt.create_plot('SPY Price')
fplt.candlestick_ochl(df[['Open','Close','High','Low']])
fplt.plot(df.Close.rolling(20).mean(), color='#f00')
fplt.plot(df.Close.ewm(span=20).mean(), color='#0f0')
fplt.show()