我正在使用Jupyter Notebook來運行我的Python代碼。我的代碼的問題是輸出給出了一個空白圖(而不是來自Python的任何錯誤消息)。我製作散景圖的Python代碼給出了空白圖
我的代碼立場如下:
from bokeh.layouts import row
from bokeh.plotting import figure, show, output_file
data = myBenchmarkData
factors = ["Group"]
x = ["Rate"]
dot = figure(title="Categorical Dot Plot", tools="", toolbar_location=None,
y_range=factors, x_range=[0,200])
dot.segment(0, factors, x, factors, line_width=2, line_color="green",)
dot.circle(x, factors, size=15, fill_color="orange", line_color="green", line_width=3,)
output_file("categorical.html", title="categorical.py example")
show(row(dot, sizing_mode="scale_width"))
當我運行這些一堆代碼,它不正確地創建一個新的HTML文件執行,但該頁面顯示與所提到的詞「集團」空白地塊y軸。 我的數據來自csv文件,並且它已正確導入。 「組」和「比率」是我的數據框中的一系列(列名)。
我做了一個測試,並硬編碼了因素和x的列表,並且情節工作正常。看來我的代碼並不理解我想要從「數據框」的「組」列中檢索因子列表,並從數據框的「速率」列中檢索x列表。
是否有瀏覽器的JavaScript控制檯中的任何錯誤訊息? – bigreddot
我該如何檢查? – user3115933
http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers – bigreddot