pymysql下报错:numpy.float64 object has no attribute 'translate'.定位到db.merge函数中,dataframe中浮点型元素的类型为numpy.float64,这种类型没有'translate'属性.网上说应该把它转化成float类型,但是之前同事的程序就能够跑通,很是奇怪.最后在linux运行这段用例,发现可以,最终确定了原来是pandas版本的问题.(之前是0.20.0,改成0.23.4后成功)
 
(当程序一样跑出不同的结果时,考虑是不是环境问题,比如一些库的版本;选择遇到问题及时确认,保证自己走的方向是正确的;一个地方卡住了,尝试下别的任务,比如windows上没法玩,试试linux上去玩)

pymysql下报错:numpy.float64 object has no attribute 'translate' 可能是pandas版本的问题的更多相关文章

  1. pymysql连接数据库报错:'NoneType' object has no attribute 'encoding'

    直接写 utf8 即可.

  2. py+selenium 明明定位不到元素,但却不报错或是报错AttributeError: 'list' object has no attribute 'click'【已解决】

    问题:定位不到元素,但却不报错或者出现报错AttributeError: 'list' object has no attribute 'click' 如图  或者  解决方法:   将”driver ...

  3. 运行报错:'_TestResult' object has no attribute 'outputBuffer'

    一.运行main函数,未生成测试报告,报错:'_TestResult' object has no attribute 'outputBuffer' 解决方式: 1.在HTMLTestReportCN ...

  4. dnspython模块报错 AttributeError: 'CNAME' object has no attribute 'address'

    有时候用到这个模块的时候会报错 AttributeError: 'CNAME' object has no attribute 'address' 如下所示 [root@ansible ch01]# ...

  5. peewee insert 数据时报错:'buffer' object has no attribute 'translate'

    错误信息: "'buffer' object has no attribute 'translate'" 场景:使用peewee insert 数据时,BlobField 字段存储 ...

  6. 关于flask登录视图报错AttributeError: '_AppCtxGlobals' object has no attribute 'user'

    在一个小程序中写了一个登录视图函数,代码如下: @app.route('/login',methods = ['GET','POST']) @oid.loginhandler def login(): ...

  7. 运行pytest,报错"AttributeError: 'module' object has no attribute 'xxx'"

    最近学习pytest被此问题困扰,敲脑壳,实在是不该.百度解决方法一大堆,我的问题怎么也解决不了,来看一下,我是怎么解决的,各位大佬勿喷,只是自己做笔记用,谢谢. 报错信息如下: 网上解决方法是这样的 ...

  8. python文件名不要跟模块名相同,报错AttributeError: 'module' object has no attribute 'Differ'

    python中的文件都会生成pyc文件,包括模块也是这样,所以调用模块的时候,实际上会调用模块.pyc文件:在这个前提下,如果将文件名命名成跟模块名一样,在同一目录下就会生成一个跟模块名一样的pyc文 ...

  9. 机器学习实战:KNN代码报错“AttributeError: 'dict' object has no attribute 'iteritems'”

    报错代码: sortedClassCount = sorted(classCount.iteritems(), key=operator.itemgetter(1), reverse=True) 解决 ...

随机推荐

  1. Git-简单的利用SourceTree提交代码

    解决办法: 小编也是新手,所以在使用SourceTree上面花了不少时间,好在简单的拉去远程代码,同步本地仓库代码搞定了.下面是步骤: 1.我们先去下载一个SourceTree然后打开. 2.下一步, ...

  2. Get Started with the Google Fonts API

    Get Started with the Google Fonts API This guide explains how to use the Google Fonts API to add fon ...

  3. java注解和反射学习

    spring框架很多地方都应用了注解,如@controller,所以要学会自定义注解及注解处理器. Class<?> cl=Class.froName(className) //通过类名加 ...

  4. 导入Excel 类型的数据

    thinkphp 访问此控制方法就可以导入了 //数据导入 public function impUser(){ if (!empty($_FILES)) { $upload = new \Think ...

  5. 新版谷歌浏览器怎么查找和改变编码格式 IT开发人员谷歌的编码格式

    解决方法在最下面,还有可下载的安装包 今天,无意中在解决一个乱码问题,后台是有过判断解决兼容性问题,但是有个别电脑还是有乱码问题,就去想改变下前台的编码格式,突然发现一向好用的谷歌,居然找不到编码格式 ...

  6. db2 活动日志激增的原因分析处理

    本文简单地介绍了DB2中日志的使用.活动日志以及首个活动日志的概念.日志满的原因.日志满的诊断.临时处理以及避免办法 日志使用 下图显示了并发事务条件下,日志使用的示意 有3个并发的程序Process ...

  7. .NET Core 2.0 单元测试中初识 IOptionsMonitor<T>

    在针对下面设置 CookieAuthenticationOptions 的扩展方法写单元测试时遇到了问题. public static IServiceCollection AddCnblogsAut ...

  8. linux下安装pycharm

    在 linux下打开浏览器,搜索pycharm,点击download. 下载好的文件的名称可能是 ‘pycharm-professional-2016.2.3.tar.gz’. 打开终端界面,输入命令 ...

  9. [No0000E7]C# 封装 与访问修饰符

    C# 支持的访问修饰符: Public Private Protected Internal Protected internal Public 访问修饰符 Public 访问修饰符允许一个类将其成员 ...

  10. MySQL命令:select查询语句

    SQL 中最常用的 SELECT 语句,用来在表中选取数据. 要记得的知识点如下: SELECT 语句格式: SELECT 要查询的列名 FROM 表名字 WHERE 限制条件: WHERE语句后: ...