在用matplotlib 中的 直方图(hist) 进行数据可视化时,报错—TypeError: ‘numpy.float64’ object cannot be interpreted as an integer,是因为hist要求数据类型为int类型,
解决方案:进行数据类型转换即可。如:df[‘price’]=df.price.astype(int)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
最新推荐文章于 2024-06-27 09:06:03 发布