python - Python无法识别用于绘图的数据框的数据类型
问题描述
我df
在 python 中有以下数据框:
Color Blue Red Green Yellow Orange
Zone
-------------------------------------------------
1A 3.5 3.6 2.9 3.2 3.9
2B 3.2 4.1 2.6 2.3 3.4
3C 2.9 3.9 3.1 2.7 3.0
以前我可以通过简单地运行来生成一个情节:
df.plot(kind='bar', color=['b', 'c', 'g', 'm', 'r'], sharey=True, legend=True, rot=True, zorder=1.6)
但是,现在运行此行会产生以下错误消息:
TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type
为什么会发生此错误,我该如何解决?
解决方案
推荐阅读
- hadoop - Hive:有条件地截断并加载表
- python - 根据列表列表中的计数在列表列表中重复值
- ios - Firebase更改显示在谷歌登录警报上的应用名称?
- shell - 终端:cp -r -u 命令不会递归地将文件夹内容复制到另一个文件夹
- node.js - Angular 6 - 如何在每个请求中维护 jwt 会话?
- oracle - 如何更改 apex oracle 中的表单图标?
- java - 使用 java.util.zip 写入大小
- twitter-bootstrap - 如何在单击箭头时更改引导 4 旋转速度?
- python-2.7 - 字典:按字母顺序排列列表的元素并计算其出现次数
- python - QT 将灰度图像绘制成伪彩色(PyQt)