第一次尝试 Bokeh 。使用来自 http://docs.bokeh.org 的以下示例代码:
from collections import OrderedDict
from bokeh.charts import Scatter
from bokeh.sampledata.iris import flowers
output_notebook()
在iPython(Anaconda, py 3.4, Win 7)中,出现如下错误:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-c57c6fa8f51a> in <module>()
----> 1 output_notebook()
NameError: name 'output_notebook' is not defined
为什么?这直接来自示例。
看起来好像您忘记导入 output_notebook
。
典型的笔记本有以下进口:
from bokeh.io import output_notebook, show
from bokeh.plotting import figure
output_notebook()
我是一名优秀的程序员,十分优秀!