我是python新手。我想在这里http://bokeh.pydata.org/en/latest/docs/gallery/color_scatter.html用我自己的数据集,它看起来像这样散景图不显示
Unnamed: 0 fans id stars
0 0 69 18kPq7GPye-YQ3LyKyAZPw 4.14
1 1 1345 rpOyqD_893cqmDAtJLbdog 3.67
2 2 105 4U9kSBLuBDU391x6bxU-YA 3.68
3 3 2 fHtTaujcyKvXglE33Z5yIw 4.64
4 4 5 SIBCL7HBkrP4llolm4SC2A 3.80
这里给出的例子是我的代码:
import pandas as pd
from bokeh.plotting import figure, show, output_file
op = pd.read_csv('FansStars.csv')
x = op.stars
y = op.fans
radii = 1.5
colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(50+2*x, 30+2*y)]
TOOLS="hover,crosshair,pan,wheel_zoom,zoom_in,zoom_out,box_zoom,undo,redo,reset,tap,save,box_select,poly_select,lasso_select,"
p = figure(tools=TOOLS)
p.scatter(x, y, radius=radii,
fill_color=colors, fill_alpha=0.6,
line_color=None)
output_file("color_scatter.html", title="color_scatter.py example")
show(p)
然而,当我运行此代码,我没有得到任何错误和网页被打开,但空白。在重新加载几次后,我终于可以看到这些工具,但仅此而已。 谁能告诉我我哪里错了? 谢谢!
有没有在您的浏览器的JavaScript控制台的任何相关的输出或日志消息? – bigreddot