Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

python - 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

When I run this in the Anaconda Prompt, I get the message "No module named 'bokeh.charts'".

I have installed bokeh 0.12.13, so the problem isn't that I haven't installed it. Indeed, other bokeh modules run fine.

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).

Does the latest version not have bokeh.charts? If so, is there an alternative?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...