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. 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 ...

  2. YAML入门

    概要 YAML(是YAML Ain't Markup Language的缩写,尾音的发音类似Camel)是一种序列化数据的语言(类似json, xml),使用轻量高可读性的语法描述list, dict ...

  3. python-Levenshtein几个计算字串相似度的函数解析

    linux环境下,没有首先安装python_Levenshtein,用法如下: 重点介绍几个该包中的几个计算字串相似度的几个函数实现. 1. Levenshtein.hamming(str1, str ...

  4. RandomForest中的feature_importance

    随机森林算法(RandomForest)的输出有一个变量是 feature_importances_ ,翻译过来是 特征重要性,具体含义是什么,这里试着解释一下. 参考官网和其他资料可以发现,RF可以 ...

  5. centos7 安装redis服务及phpredis扩展

    闲话少说 服务器版本:centos7.6 64位 软件包:https://pan.baidu.com/s/1Gb4iz5mqLqNVWvvZdBiOMQ 提取码: xrhx 一.安装redis 放在/ ...

  6. ubuntu-18.04 root登录图形界面失败问题解决方案

    一.设置root密码 二.进入/etc/pam.d目录 主要修改两个文件(圈了红色框框),记得命令行下切换root账户(sudo -i)进行vim修改,刚安装的ubuntu没有vim支持,请根据提示进 ...

  7. Flask----目录结构

    以此结构为例,这个小项目是<Flask Web开发:基于python的web应用开发实战>第一部分结束后的代码框架 第一层 有app.tests.migrations三个文件夹和confi ...

  8. GDB常用调试命令以及多进程多线程调试

    http://blog.csdn.net/freeelinux/article/details/53700266 一:普通命令   1.list命令 list  linenum      显示程序第l ...

  9. secureCRT修改背景色、字体颜色

    参考: http://blog.csdn.net/jediael_lu/article/details/37729465 http://blog.csdn.net/dagefeijiqumeiguo/ ...

  10. c#构造函数对string类型赋初值

    public class Stu { public Stu() { //当成员属性非常多难以一一赋值时,采用本方法.当然写代码逐一成员直接赋值效率更高. AssignEmptyStringMember ...