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 ...
随机推荐
- C++11版本不能使用一个单行命名空间方式特化一个函数的bug
warning: specialization of ‘template<class _Iterator> struct std::iterator_traits’ in differen ...
- Netty 4 实现一个 NettyClient
本文章为作者原创,有问题的地方请提出指正. 1.类继承Diagram 2.定义EndPoint类 目前仅仅定义了2个方法,分别用来获取本地或远程服务器的地址. package netty; impor ...
- 【Python】解析Python中的线程与进程
基础知识 线程 进程 两者的区别 线程的类型 Python 多线程 GIL 创建多线程 线程合并 线程同步与互斥锁 可重入锁(递归锁) 守护线程 定时器 Python 多进程 创建多进程 多进程通信 ...
- Android Studio运行Hello World程序
老的神舟本本装上了深度LINUX了...应该是基于ubuntu的,安装软件用的apt-get而不是yum 想重装学下android原生开发,官网下载了android studio, 发现不用FQ也能下 ...
- sqlserver存储过程创建和java调用
创建存储过程 CREATE procedure [dbo].[getdata_monitor_city_hour_hb] ), ) OUT as begin SET @test = '失败'; if ...
- 配置Pods和containers--为Containers和Pods分配CPU资源
指定CPU请求和CPU限制 要为容器指定CPU请求,在容器资源清单中使用resources:requests字段.要指定CPU限制,使用resources:limits. cpu-request-li ...
- PMP ITTO工具
整合管理 范围管理 进度管理 成本管理 质量 资源管理 沟通管理 风险管理 采购管理 相关方管理
- Appium脚本(5) 元素等待方法示例
思考 在自动化过程中,元素出现受网络环境,设备性能等多种因素影响.因此元素加载的时间可能不一致,从而会导致元素无法定位超时报错,但是实际上元素是正常加载了的,只是出现时间晚一点而已.那么如何解决这个问 ...
- SpokenEnglish01_ When's it due?
1 Pronunciation and Intonation When's it due? 解析:When’s it due? 2 Key Points 2.1 Due adj: 到期的,截止的 It ...
- [Linux]Linux下samba创建共享文件
1. 安装samba服务 yum install -y samba 2. 创建需要共享的目录 在目录/home/xxxx/share xxx为用户名 mkdir share 修改该目录权限(上层文件夹 ...