PlotlyError:因为您没有在调用中提供'file_id',所以我们假设您正在尝试从URL中获取数字。您提供了网址“ https://chart-studio.plotly.com/~Rahela/4”,我们希望它以“ https://plot.ly”开头。
这是代码,我正在尝试运行此单元格。请有人帮忙。
sales_dist = [go.Histogram(x=df.Sales, marker=dict(color='pink'))]
layout2 = go.Layout(title='Sales Distribution', xaxis=dict(title='daily sales in $'), yaxis=dict(title='number of observations'))
fig2 = go.Figure(data=sales_dist, layout=layout2)
py.iplot(fig2)
我遵循了。 第1步:在Plotly上创建一个帐户。
第2步:生成位于设置下的API。
第3步:请输入您的用户名和api密钥,然后运行以下代码。
密谋导入
plotly.tools.set_credentials_file(username ='#MyUsername',api_key ='#apiKey')