python - 有错误的 Holoviews 条返回 TypeError:不支持的操作数类型 -:'str' 和 'float'
问题描述
我尝试用错误做一个全息条图。
单独的条形图正在工作,但是当我添加错误图时,我收到以下错误消息:
TypeError: unsupported operand type(s) for -: 'str' and 'float'
版本是:bokeh=2.0.2,holoviews=1.13.3
pandas DataFrame 中的数据对于 Cat1 和 Cat2 是分类的,对于 Value 是浮动的:
Cat1 Cat2 Value
0 A C 712.788035
1 A C 532.259371
2 A D 381.516398
3 A D 281.396654
4 B C 412.779620
5 B C 281.261148
6 B D 271.261342
7 B D 0.000000
我的代码如下所示:
bars = hv.Bars(df,kdims=['Cat1','Cat2'], vdims=['Value'])
errors = hv.ErrorBars(df, kdims=['Cat1','Cat2'], vdims=['Value'])
plot = bars * errors
plot
解决方案
推荐阅读
- css - 垂直对齐不适用于自定义控件
- hadoop - Apache Ozone + AWS S3 .Net API:PutObject 正在创建存储桶而不是密钥
- kubernetes - Helm:模板中的中断循环(范围)
- jenkins - Jenkins:历史记录中任何已完成构建的自定义命令,可访问此构建的 ID,理想情况下来自构建历史菜单
- java - 如何以 application/x-www-form-urlencoded 格式将正文添加到 HTTPURLConnection 中的 POST 调用
- java - RootDSE 中的 SearchRequest
- ios - Swift:如何存储数组数据,以便下课后可以多次访问?
- r - grid.Call.graphics 中的错误(C_polygon,x$x,x$y,index):“cluster”(包 Mclust)中的颜色名称无效
- python - 使用元组从字典中提取值
- python - API 教程中的 WinError 10054