我有一些带有时间戳的特定事件,想要创建一个热图:
我的数据(作为pandas数据帧z.head()):
date hour i
0 2016-01-15 13 1
1 2016-01-15 13 1
2 2016-01-15 12 1
3 2016-01-15 10 1
4 2016-01-15 10 1
Run Code Online (Sandbox Code Playgroud)
我失败的尝试:
from bokeh._legacy_charts import HeatMap, output_file, show
hm = HeatMap(z.head(), x='date', y='hour', values='i', stat='count')
Run Code Online (Sandbox Code Playgroud)
例外情况:
AttributeError Traceback (most recent call last)
<ipython-input-98-83c7e9319496> in <module>()
----> 1 hm = HeatMap(z.head(), x='date', y='hour', values='i', stat='count')
/home/user/.local/lib/python3.4/site-packages/bokeh/charts/builders/heatmap_builder.py in HeatMap(data, x, y, values, stat, xgrid, ygrid, hover_tool, hover_text, **kw)
90 kw['values'] = values …Run Code Online (Sandbox Code Playgroud)