Bokeh Heatmap error: object has no attribute 'split'

Bokeh Heatmap error: object has no attribute 'split'

首先,散景热图 google 搜索结果已损坏。其次,当我尝试使用热图代码的 Google 缓存版本时,或者就此而言,我可以找到任何其他热图代码示例时,我不断收到错误消息:

AttributeError: 'pandas._libs.interval.Interval' object has no attribute 'split'

我正在尝试 运行 在 Jupyter 中执行此操作,我怀疑它无法拆分输入数据,但不确定如何更正。

是代码有误,还是我的系统有问题?

import pandas as pd
from bokeh.charts import HeatMap, output_file, show

z = pd.DataFrame()
z['date'] = ['2016-01-15', '2016-01-13', '2016-01-11', '2016-01-14', '2016-01-15']
z['hour'] = [12, 10, 11, 3, 0]
z['i'] = [1, 1, 1, 1, 1]

output_file('/tmp/test.html')
hm = HeatMap(z, x='date', y='hour', stat='count')
show(hm)

Pandas 最近在新版本中引入了重大更改。目前,要继续使用 bokeh.charts,最好的办法是降级 Pandas 版本。