用什么代替 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,所以问题不在于我没有安装它.事实上,其他散景模块运行良好.
I have installed bokeh 0.12.13, so the problem isn't that I haven't installed it. Indeed, other bokeh modules run fine.
我在散景网站上注意到图表"模块说它指的是以前的版本(参见 https://docs.bokeh.org/en/0.12.4/docs/reference/charts.html).
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,它支持更高级的交互式统计和 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屋!