通过搜索原因,发现有可能是在对文件读取是编译出现了问题,并且Keyword中提示b'Iris-setosa',而我们的string转float函数中没有字母b,很奇怪。所以尝试将转换函数所有的string前加b。结果发现数据读取正常。
下边附上转换函数:

def iris_type(s):
it = {b'Iris-setosa': , b'Iris-versicolor': , b'Iris-virginica': }
return it[s]

python3 load Iris.data数据集出现报错key words: b'Iris-setosa'的更多相关文章

  1. jmeter "you cannot switch bacause data cannot be converted to target Tab data,empty data to switch"报错

    jmeter "you cannot switch bacause data cannot be converted to target Tab data,empty data to swi ...

  2. 【ELK】elasticsearch使用bulk 导入批量的数据集文件报错:Validation Failed: 1: no requests added

    执行命令如下: curl -XPOST http://192.168.6.16:9200/my_new_index/user/_bulk?pretty --data-binary @/cjf/es/e ...

  3. 问题: Octave 改变文件目录后 pkg load 加载第三方库报错

    懒得重新安装Octave,就直接从原来安装的目录中复制出来,使用pkg load image命令时会显示报错 pkg load image warning: addpath: "origin ...

  4. 【spring data jpa】报错如下:Caused by: javax.persistence.EntityNotFoundException: Unable to find com.rollong.chinatower.server.persistence.entity.staff.Department with id 0

    报错如下: org.springframework.orm.jpa.JpaObjectRetrievalFailureException: Unable to find com.rollong.chi ...

  5. Python3 fake_useragent 模块的使用和报错解决方案

    在使用 Python 做爬虫的时候,我们需要伪装头部信息骗过网站的防爬策略,Python 中的第三方模块 fake_useragent 就很好的解决了这个问题,它将给我们返回一个随机封装了好的头部信息 ...

  6. 吴恩达深度学习第4课第3周编程作业 + PIL + Python3 + Anaconda环境 + Ubuntu + 导入PIL报错的解决

    问题描述: 做吴恩达深度学习第4课第3周编程作业时导入PIL包报错. 我的环境: 已经安装了Tensorflow GPU 版本 Python3 Anaconda 解决办法: 安装pillow模块,而不 ...

  7. python3中post请求里带list报错

    这个post请求的数据太长,一般data=,json=就够了. 但是今天这个一直报错,用json吧,报缺少参数,用data吧,报多余[. 后来改成data=,并把数据中的[] 用引号括起来," ...

  8. windows anaconda python3.7 import ssl,psycopg2报错

    使用anaconda,本来是为了减少装第三方模块依赖出错问题的. 但是,今天发现,也是有坑啊. 首先 import ssl 报错,import _ssl 说DLL load failed 解决办法:用 ...

  9. python接口自动化:python3.6中import Crypto.Hash报错的解决方案

    一:问题 python3.6中算法加密引入包Crypto报错,即便安装了: pip install crypto pip install pycrypto pip install pycryptodo ...

随机推荐

  1. Beamer中左边画图, 右边文字解释

    \begin{columns} \column{.4\textwidth} \begin{figure} \centering % Requires \usepackage{graphicx} \in ...

  2. shell1

    shebang = sharp-bang = #! 1.echo $PATH export PATH="$PATH:/home/user/bin" PREPEND prepend( ...

  3. mysql 以数组的形式插入更新表

    在项目中用php+mysql,需要插入数据,但是数据库表字段又很长,如果用常规的insert into table (c) values ('dd')的话,将是很长的sql语句,而且一不小心,就弄错了 ...

  4. windows服务器基本管理及服务搭建

    windows服务器基本管理及服务搭建 ****windows服务器系统版本:2000 2003 2008 2012 1.用户与组管理 用户:账户=账号/用户名+密码 每个账户有自己唯一的SID 账户 ...

  5. 玩转ubuntu之初体验

    安装的是ubuntu16.04.1,分区和具体细节就不多说了,非常简单 安装完之后要做的几件事: 1.设置root密码 #设置root密码 sudo passwd root 2.检查并更新系统 #ub ...

  6. java(9)类和对象

    一.理解什么是类和对象 万事万物皆对象 1.1.属性——对象具有的特征(特点) 1.2.方法——对象可执行的操作(能干什么事) 1.3.对象的定义: 是一个客观存在的,看的见或摸得着的实体,由属性和方 ...

  7. day 13 - 1 迭代器

    迭代器 首先我们查看下列类型拥有的所有方法(会显示很多) print(dir([])) print(dir({})) print(dir('')) print(dir(range(10))) #求下上 ...

  8. window开发环境常用操作

    1. 启动redis命令 redis-server redis.windows.conf 如果法正常启用,出现如下问题 windows下第一次通过以下命令启动redis (*:此处整理转载自:http ...

  9. C语言之路-2-判断

    #include<stdio.h> int main() { ; printf("请输入"); scanf("%d",&a); ){ pri ...

  10. Sublime text3 连接sftp/ftp(远程服务器)

    1.按下Ctrl + Shift + P调出命令面板2.在输入框中输入Sftp,按回车下载3.建一个新的文件夹放到左边的项目栏中4.右击文件夹,选中SFTP/FTP,点击Map to Remote5. ...