저는 Python을 처음 사용합니다. 이 코드를 실행하면, 나는 오류 및 웹 페이지를 얻을, 그러나Bokeh 그림이 표시되지 않습니다.
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)
: 여기이
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
처럼 보이는 내 자신의 데이터 세트, 여기 http://bokeh.pydata.org/en/latest/docs/gallery/color_scatter.html에 주어진 예제를 시도하는 것은 내 코드입니다 빈칸이 열렸습니다. 여러 번 다시로드하면 마침내 도구를 볼 수 있지만 그게 전부입니다. 아무도 내가 잘못 가고 있다고 말할 수 있습니까? 감사합니다.
있습니까? – bigreddot