用什么代替bokeh.charts [英] What to use instead of bokeh.charts
问题描述
我正在尝试运行其他人编写的一些代码,其中包含以下行
I am trying to run some code written by someone else, which contains the line
from bokeh.charts import Bar
当我在Anaconda Prompt中运行此命令时,收到消息没有名为'bokeh.charts'的模块".
When I run this in the Anaconda Prompt, I get the message "No module named 'bokeh.charts'".
我已经安装了bokeh 0.12.13,所以问题不在于我还没有安装它.确实,其他bokeh模块运行良好.
I have installed bokeh 0.12.13, so the problem isn't that I haven't installed it. Indeed, other bokeh modules run fine.
我在bokeh网站上注意到,图表"模块表示它是指以前的版本(请参见
I have noticed on the bokeh website that the 'charts' module says that it refers to a previous version (see https://docs.bokeh.org/en/0.12.4/docs/reference/charts.html).
最新版本没有bokeh.charts吗?如果是这样,还有其他选择吗?
Does the latest version not have bokeh.charts? If so, is there an alternative?
推荐答案
bokeh.charts
很久以前已被弃用,随后被删除.该代码仍然存在于GitHub上的 bokeh/bkcharts
存储库中,但是它完全没有维护,我也不会建议任何人在此时使用它.
bokeh.charts
was deprecated quite a long time ago, and subsequently removed. The code still exists in the bokeh/bkcharts
repository on GitHub, however it is entirely unmaintained, and I would not recommend anyone to use it at this point.
根据您要执行的操作,稳定且受支持的bokeh.plotting
可能就足够了.有很多改进,以前需要bokeh.charts
的许多图表类型现在可以很容易地用bokeh.plotting
制作.例如,请参见《用户指南》的处理分类数据部分.
Depending on what you want to do, stable and supported bokeh.plotting
may be sufficient. There have been lots of improvements and many chart types that previously required bokeh.charts
are now simple to make with bokeh.plotting
. See the Handling Categorical Data section of the User's guide for example.
否则,如果您希望基于Bokeh构建的非常高级的API,该API支持更高级的交互式统计和GIS图表类型,请查看全景视图.
Otherwise, if you want a very high level API, built on top of Bokeh, that supports more advanced interactive statistical and GIS chart types, have a look at Holoviews.
这篇关于用什么代替bokeh.charts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!