我不熟悉plotly,这是我在kaggle上写的代码:
import chart_studio.plotly as py
import plotly.graph_objects as go
df = timesData.iloc[:100,:]
traceC = go.Scatter(
x = df.world_rank,
y = df.citations,
mode = "lines",
name = "citations",
marker = dict(color = "rgba(160, 151, 216, 1)"),
text = df.university_name
)
traceT = go.Scatter(
x = df.world_rank,
y = df.teaching,
mode = "lines+markers",
name = "teaching",
marker = dict(color = "rgba(5, 181, 194, 1)"),
text = df.university_name
)
data = [traceC, traceT]
layout = dict(title = "Citation and Teaching vs World Rank of Top 100 Universities",
xaxis = dict(title = "World Rank", ticklen = 5, zeroline = False))
fig = dict(data = data, layout = layout)
iplot(fig)
这就是我得到的错误:
PlotlyRequestError: Authentication credentials were not provided.
我还将plotly.plotly更改为chart_studio.plotly,因为我在那里遇到了另一个错误
我能做什么
如果这样做有效,您是否介意尝试一下:
相关问题 更多 >
编程相关推荐