成功解决TypeError: can't multiply sequence by non-int of type 'float'

目录

解决问题

解决思路

解决方法

1、分析bug

2、定位出错函数


解决问题

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以上条件才可以!

哈哈,大功告成!

成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘相关推荐

  1. 成功解决TypeError: sequence item 0: expected str instance, list found

    成功解决TypeError: sequence item 0: expected str instance, list found 目录 解决问题 解决思路 解决方法 解决问题 TypeError: ...

  2. 成功解决TypeError: sequence item 0: expected str instance, bytes found

    成功解决TypeError: sequence item 0: expected str instance, bytes found 目录 解决问题 解决思路 解决方法 解决问题 TypeError: ...

  3. 成功解决TypeError: ‘tuple‘ object is not callable

    成功解决TypeError: 'tuple' object is not callable 目录 解决问题 解决思路 解决方法 解决问题 TypeError: 'tuple' object is no ...

  4. 成功解决TypeError: data type ‘category‘ not understood

    成功解决TypeError: data type 'category' not understood 目录 解决问题 解决思路 解决方法 解决问题 TypeError: data type 'cate ...

  5. 成功解决TypeError: ‘str‘ object is not callable

    成功解决TypeError: 'str' object is not callable 目录 解决问题 解决思路 解决方法 解决问题 TypeError: 'st

  6. 成功解决TypeError: read_excel() got an unexpected keyword argument ‘parse_cols or ‘sheetname‘

    成功解决TypeError: read_excel() got an unexpected keyword argument 'parse_cols' TypeError: read_excel() ...

  7. 成功解决TypeError: take() got an unexpected keyword argument ‘fill_value‘

    成功解决TypeError: take() got an unexpected keyword argument 'fill_value' 目录 解决问题 解决思路 解决方法 解决问题 Traceba ...

  8. 成功解决TypeError: Encoders require their input to be uniformly strings or numbers. Got [‘float‘, ‘int‘,

    成功解决TypeError: Encoders require their input to be uniformly strings or numbers. Got ['float', 'int', ...

  9. 成功解决TypeError: object of type ‘int‘ has no len()

    成功解决TypeError: object of type 'int' has no len() 目录 解决问题 解决思路 解决方法 解决问题 TypeError: object of type 'i ...

最新文章

  1. C++——简单数据类型及布尔类型
  2. 【Python】将字典(dict)转化为Dataframe
  3. geoserver加载mysql_GeoServer+MySQL的配置过程
  4. 《Android艺术开发探索》学习笔记之View的事件体系(一)
  5. 【ArcGIS遇上Python】使用add-in向导开发ArcGIS插件(1):add-in工具介绍及安装
  6. ubuntu - 如何以root身份使用图形界面管理文件?
  7. windows下搭建Vagrant+Virtualbox环境
  8. java需求设计_JavaWeb期末设计---需求分析文档. stage1
  9. python filter函数 字符串_Python实现filter函数实现字符串切分
  10. JSP Include 文件方式
  11. 做一个管理者/技术负责人的学习之路--001
  12. 阿里巴巴Java开发手册(详尽PDF版).
  13. android wear已停止运行,魔百盒显示“很抱歉CMCCWiMo已停止运行解决方法
  14. 抓包实现原理与反抓包
  15. android app申请内存大小,Android中App可分配内存的大小
  16. 两种图像拼接(无重叠相邻图有重叠相邻图)以及matlab实现(边线查找法)
  17. 10个谈话技巧让你平步青云(转贴)
  18. 福利贴:最全实时音视频开发要用到的开源工程汇总
  19. 我的物联网项目(二十七) 分布式锁粗心导致大量阻塞
  20. 【学习笔记】IP地址块的聚合

热门文章

  1. 微信隐藏功能盘点:修复聊天记录
  2. [BT_Books]《无线蓝牙技术深入探讨》笔记
  3. 记录下如何用vue实现PC端网易云轮播图效果
  4. SQL Server 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作
  5. Unity3D本地文件夹的创建、删除(Directory文件夹删除和单个文件删除)
  6. 计算机专业课学习清单(书籍+公开课)
  7. 2022-2028全球ERV空气交换器行业调研及趋势分析报告
  8. vlookup匹配的文字显示0_VLOOKUP函数用法大全
  9. 分享Silverlight/WPF/Windows Phone一周学习导读(06月06日-06月11日)
  10. Debian 10安装教程