gpt4 book ai didi

python - output_notebook() 未定义 - 为什么?

转载 作者:太空宇宙 更新时间:2023-11-04 08:07:24 26 4
gpt4 key购买 nike

第一次尝试 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()

关于python - output_notebook() 未定义 - 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28917818/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com