当前位置:网站首页>成功解决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以上条件才可以!
哈哈,大功告成!
边栏推荐
- golang刷leetcode:我能赢吗
- 回文自动机+CodeTON Round 2 C,D
- Mysql用户管理
- Add and delete all these years, finally planted in MySQL architecture design!
- 汉源高科2光12电千兆导轨式网管型工业以太网交换机双光自愈保护式以太网光交换机
- 汉源高科千兆4光4电工业级网管型智能环网冗余以太网交换机防浪涌防雷导轨式安装
- WPF development through practical 】 【 automatic production management platform
- JumpServer开源堡垒机完成龙芯架构兼容性认证
- 单例模式你会几种写法?
- Redis是如何轻松实现系统秒杀的?
猜你喜欢
面试官:可以谈谈乐观锁和悲观锁吗
饥荒联机版Mod开发——制作简单的物品(三)
win10安全中心设置不扫描某个文件夹的方法
用户之声 | 大学生的“课外学堂”
源码构建LAMP环境-2
宝塔搭建实测-基于ThinkPHP5.1的wms进销存源码
YOLOv5+BiSeNet——同时进行目标检测和语义分割
2022-08-02 第六小组 瞒春 学习笔记
华为设备配置BFD多跳检测
I interviewed a 985 graduate, and I will never forget the expression when answering the "performance tuning" question
随机推荐
最近火爆朋友圈的“广告电商”,核心商业模式是什么,广告收入真实靠谱吗?
人尽皆知的云原生,到底是大势所趋还是过度炒作?
面试官:可以谈谈乐观锁和悲观锁吗
Flink优化及相关
golang 刷leetcode:统计打字方案数
SRv6网络演进面临的挑战
golang 刷leetcode:将字符串翻转到单调递增
golang刷leetcode:我能赢吗
Swin Transformer 论文精读,并解析其模型结构
[C题目]力扣234. 回文链表
解道8-编程技术5
golang刷leetcode:按位与结果大于零的最长组合
VisualStudio 制作Dynamic Link Library动态链接库文件
Vscode快速入门、 插件安装、插件位置、修改vscode默认引用插件的路径、在命令行总配置code、快捷键
golang刷leetcode:道路的最大总重要性
WPF development through practical 】 【 automatic production management platform
Informatics orsay a tong (1258: 【 9.2 】 digital pyramid)
CS5213芯片|HDMI to VGA转换头芯片资料分享
典型相关分析CCA计算过程
Electrical diagram of power supply system