pandas-11 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely错误解决方法
pandas-11 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely错误解决方法
将一个list矩阵转化为numpy数组之后,使用np.isnan()方法,报出了这么一个错误:
TypeError: ufunc ‘isnan’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’
经过测试,发现是二维list转化为numpy数组的时候就存在问题了。
出错原因是list第二维的元素个数不一致导致如:
list1 = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9, 10]]
这时候使用 np.array(list1),输出如下内容:
[
list(1, 2, 3),
list(4, 5, 6),
list(7, 8, 9, 10)]
接着使用np.isnan()方法,就会报出最上面的错误。
因为第三行是4个元素,所以无法转化为我们想要的numpy数组,解决方法就是将列数改为一致即可。
pandas-11 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely错误解决方法的更多相关文章
- tpot ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
机器学习训练的时候报出这个问题 是因为dataframe中的数据类型有一个是‘object’,把它转成int,或float 就行,如下 df['A'] = df['A‘].astype(int) 参考 ...
- 显示 Uncaught TypeError: Cannot read property 'dialog' of undefined”的错误解决方法
最近在做一个基于easyUI的列表,新增功能的弹出框是以这样的方式: 运行测试的时候,报了这一堆的错误Uncaught TypeError: Cannot read property 'dialog' ...
- jquery中Uncaught TypeError: $(...).ajaxUpload is not a function(…)错误解决方法
错误原因:该函数不是jquery的核心函数,所以需要外部引入ajaxfileupload.js文件,可能是没有引入,或者引入的js文件互相冲突 解决方法:每次进入一个函数之前打印该函数所有的js文件, ...
- 使用jquery插件报错:TypeError:$.browser is undefined的解决方法
关于$.browser browser就是用来获取浏览器基本信息的. jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.sup ...
- FTP出现211-Extension supported 停止的解决方法
FTP出问题211-Extension supported 停止的解决方法 FTP出问题211-Extension supported 停止的解决方法 FLASHFXP FTP上传登录时提示Exten ...
- embedded dylibs/frameworks are only supported on iOS 8.0 and later 错误解决
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later ld: embedded dylibs/frameworks ar ...
- SQLyog 报错2058 :连接 mysql 8.0.11 解决方法
下载新版的 mysql 8.0.11 安装. 为了方便安装查看,我下载了sqlyog 工具 连接 mysql 配置新连接报错:错误号码 2058,分析是 mysql 密码加密方法变了. 解决方法:wi ...
- EF C# ToPagedList方法 The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must ……
报错信息:The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' ...
- Request method 'POST' not supported错误和解决方法
在使用SpringBoot的时候,在html页面用form表单post提交数据的时候报错: Request method 'POST' not supported 错误解析: 我是用的前端页面是HTM ...
随机推荐
- springboot(1)@SpringBootApplication
首先来看下Spring Boot项目中的运行类,基本上每个项目都会有该启动类: @SpringBootApplication public class Application { public sta ...
- shell (7)if 表达式
文件表达式if [ -f file ] 如果文件存在if [ -d … ] 如果目录存在if [ -s file ] 如果文件存在且非空if [ -r file ] 如果文件存在且可读if [ -w ...
- Python3基础 print %xX 十六进制大小写
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- WebGL学习笔记(九):阴影
3D中实现实时阴影技术中比较常见的方式是阴影映射(Shadow Mapping),我们这里也以这种技术来实现实时阴影. 阴影映射背后的思路非常简单:我们先以光的位置为视角进行渲染,我们能看到的东西都将 ...
- mac node配置path
一.查看node安装路径 whitch node 二.打开配置文件 vi ./.bash_profile 三.添加一行PATH(按i进入insert才能编辑) export NODE_HOME=&qu ...
- 初识RxSwift
初识Observable Observable<T> 这个类就是Rx框架的基础, 我们可以称他为可观察序列, 他的作用就是可以异步的产生一系列的Event(事件), 即一个Observab ...
- Egret自定义位图文字(自定义+BitmapLabel)
一 自定位图文字 因为egret的位图文字是texturemerger做的,需要多张单图片导入tm,然后导出两个文件来使用,过程比较麻烦. 而Laya的位图文字则是一张整图数字图片,使用FontCli ...
- 全基因组关联分析学习资料(GWAS tutorial)
前言 很多人问我有没有关于全基因组关联分析(GWAS)原理的书籍或者文章推荐. 其实我个人觉得,做这个分析,先从跑流程开始,再去看原理. 为什么这么说呢,因为对于初学者来说,跑流程就像一个大黑洞,学习 ...
- Struts2访问Servlet
知识点: servlet是单例的,Action是多例的,一次请求,创建一个Action的实例 结果页面分为全局和局部两类(局部优先级更高) result标签:name : 默认succestype : ...
- Vue 组件封装发布到npm 报错 Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined 原因是 没有导出 export default { name:& ...