当前位置:网站首页>成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘
成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘
2022-08-11 00:33:00 【一个处女座的程序猿】
成功解决TypeError: can't multiply sequence by non-int of type 'float'
目录
解决问题
TypeError: can't multiply sequence by non-int of type 'float'
解决思路
类型错误:不能将sequence乘以“float”类型的非整数
解决方法
两个数据类型不一致,不能够进行multiply运算!重新检查输入数据类型,本案例问题的背景是在特征工程过程中遇到的,
feature: string or list.feature or feature list to investigate,for one-hot encoding features, feature list is required.字符串或列表,要调查的特征或特征列表,对于one-hot编码特征,需要特征列表。
经过分析,发现输入的数据类型为object,而函数要求int或者float类型。
故更改数据变量类型即可!
边栏推荐
猜你喜欢
异常和异常处理机制
PMP每日一练 | 考试不迷路-8.10(包含敏捷+多选)
Qt入门(六)——抽奖系统的实现
Dump文件生成,内容,以及分析
微信小程序通过URL Scheme动态的渲染数据
Software Testing Certificate (1) - Software Evaluator
IEEE的论文哪里可以下载?
时间戳转换为日期格式、获取当前时间戳
Which foreign language journals and conferences can be submitted for software engineering/system software/programming language?
Web-based meal ordering system in epidemic quarantine area
随机推荐
Design and Realization of Employment Management System in Colleges and Universities
More parameter exposure of Pico 4: Pancake + color perspective, and Pro version
How to build speed, speed up again
“蔚来杯“2022牛客暑期多校训练营4 ADHK题解
Design and implementation of flower online sales management system
英文文献阅读时,如何做笔记?
【经典排序】快速排序
【js】获取当前时间的前后n天或前后n个月(时分秒年月日都可)
YOLOv5的Tricks | 【Trick11】在线模型训练可视化工具wandb(Weights & Biases)
关于编程本质那些事
leetcode 前K个高频单词
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 3 DF Problem Solving
SAP ABAP JSON 格式数据处理
2022.8.10-----leetcode.640
分库分表ShardingSphere-JDBC笔记整理
Pico 4更多参数曝光:Pancake+彩色透视,还有Pro版本
Where can I download IEEE papers?
C# using timer
云原生-FRP内网穿透(详解)使用云服务器将内网集群服务暴露至公网(二)
【.NET Core】使用 NPOI 读写Excel 文件