当前位置:网站首页>成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘
成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘
2022-08-02 21:21:00 【一个处女座的程序猿】
成功解决TypeError: can't multiply sequence by non-int of type 'float'
目录
解决问题
TypeError: can't multiply sequence by non-int of type 'float'
解决思路
类型错误:不能将序列乘以float类型的非int类型
解决方法
1、分析bug
失败运行的结果
['male' 'female' 'female' 'female' 'male' 'male' 'male' 'male' 'female'
'female']
value_grids = np.percentile(feature_values, percentile_grids)
TypeError: can't multiply sequence by non-int of type 'float'
成功运行的结果
[1 0 0 0 1 1 1 1 0 0]
2、定位出错函数
分析函数的输入参数,分析出错参数feature,分发现该参数的规则是
feature: string or list, feature or feature list to investigate, for one-hot encoding features, feature list is required
故输入数据及数据类型,应该满足 one-hot encoding features以上条件才可以!
哈哈,大功告成!
边栏推荐
猜你喜欢
Zabbix 5.0 监控教程(二)
[C题目]力扣142. 环形链表 II
快速构建电脑软件系统 、超好用经典的网页推荐汇总
饥荒联机版Mod开发——制作简单的物品(三)
字节内部技术图谱 惊艳级实用
Finally understand: With threads, why do we need coroutines?
How to quickly compare two byte arrays for equality in .NET
如何成为一名正义黑客?你应该学习什么?
VisualStudio 制作Dynamic Link Library动态链接库文件
Jar包启动通过ClassPathResource获取不到文件路径问题
随机推荐
饥荒联机版Mod开发——制作简单的物品(三)
双轴晶体中锥形折射的建模与应用
Xcode13.1 run engineering error fatal error: 'IFlyMSC/IFly h' file not found
js函数防抖和函数节流及其他使用场景
增删改查这么多年,最后栽在MySQL的架构设计上!
SRv6网络演进面临的挑战
I interviewed a 985 graduate, and I will never forget the expression when answering the "performance tuning" question
js how to get the browser zoom ratio
How the sensor works
[c] Detailed explanation of operators (1)
Zabbix 5.0 监控教程(二)
微软SQL服务器被黑客入侵以窃取代理服务的带宽
@Transactional 事务调用与生效场景总结
最近火爆朋友圈的“广告电商”,核心商业模式是什么,广告收入真实靠谱吗?
Use the TCP protocol, we won't lost package?
golang刷leetcode:我能赢吗
golang刷leetcode: 卖木头块
ORB SLAM3加载Vocabulary更快ORBvoc.bin
Ansible安装与配置
解道8-编程技术5