当前位置:网站首页>成功解决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以上条件才可以!
哈哈,大功告成!
边栏推荐
- VisualStudio 制作Dynamic Link Library动态链接库文件
- 双轴晶体中的锥形折射
- The interviewer asked me: delete library, in addition to run do?
- 快速学会ansible的安装
- What is the core business model of the "advertising e-commerce" that has recently become popular in the circle of friends, and is the advertising revenue really reliable?
- Jar包启动通过ClassPathResource获取不到文件路径问题
- The software testing process specification is what?Specific what to do?
- Flink优化及相关
- [c] Detailed explanation of operators (1)
- 【3D视觉】深度摄像头与3D重建
猜你喜欢
随机推荐
典型相关分析CCA计算过程
win10安全中心设置不扫描某个文件夹的方法
[Dry goods] Best practice of sub-library and sub-table
ICLR 2022最佳论文:基于对比消歧的偏标签学习
【c】操作符详解(一)
Informatics orsay a tong (1258: 【 9.2 】 digital pyramid)
YARN资源调度系统介绍
源码构建LAMP环境-2
抽象工厂模式
@Transactional 事务调用与生效场景总结
C# Monitor class
微软SQL服务器被黑客入侵以窃取代理服务的带宽
SublimeText3 安装、配置项、包管理、常用必备插件、常用快捷键以及修改
主成分分析(PCA)
如何抓住NFT、元|宇|宙新趋势?
手把手教你干掉if else
golang刷leetcode:巫师的总力量和
HCIP--BGP基础实验
【模型压缩】实例分析量化原理
Redis是如何轻松实现系统秒杀的?