gpt4 book ai didi

python - 我收到 : chart_studio. 异常。PlotlyRequestError:未提供身份验证凭据

转载 作者:行者123 更新时间:2023-12-04 11:23:57 26 4
gpt4 key购买 nike

我在本地工作(在我的电脑上)只是测试和学习 PLOTLY 3.7.5。
anaconda env 处于事件状态。
代码示例由 plotly 给出

代码:

import plotly.plotly as py  # Here all begins (Look)
# import chart_studio.plotly as py # inted of the line bellow (optional to try)
import plotly.graph_objs as go
import pandas as pd
from datetime import datetime

if __name__ == '__main__':
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
trace = go.Ohlc(x=df['Date'],
open=df['AAPL.Open'],
high=df['AAPL.High'],
low=df['AAPL.Low'],
close=df['AAPL.Close'])
data = [trace]
py.iplot(data, filename='simple_ohlc')

注意(看):我收到警告错误:

'please install the chart-studio package and use the chart_studio.plotly module instead.'

最佳答案

您需要 plotly 的离线模式来避免身份验证 - 关注 https://stackoverflow.com/a/44694854/1021819 ,而是做:

from plotly.offline import iplot

关于python - 我收到 : chart_studio. 异常。PlotlyRequestError:未提供身份验证凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59031964/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com