Dir*_*irk 1 python ipython anaconda bokeh
第一次尝试散景.使用bokeh.pydata.org中的以下示例代码:
from collections import OrderedDict
from bokeh.charts import Scatter
from bokeh.sampledata.iris import flowers
output_notebook()
Run Code Online (Sandbox Code Playgroud)
在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
Run Code Online (Sandbox Code Playgroud)
为什么?这是直接的例子.
看起来好像忘了导入output_notebook.
该output_notebook教程笔记本有以下进口:
from bokeh.io import output_notebook, show
from bokeh.plotting import figure
output_notebook()
Run Code Online (Sandbox Code Playgroud)
该行output_notebook隐式将output_notebook函数拉入命名空间.