关于“‘c‘ argument has 1 elements, which is not acceptable for use with ‘x‘ with size 300“的解决办法
以下代码
plt.scatter(X[0, :], X[1, :], c=y, cmap=plt.cm.Spectral)
报错:
ValueError: RGBA sequence should have length 3 or 4During handling of the above exception, another exception occurred:......ValueError: 'c' argument has 1 elements, which is not acceptable for use with 'x' with size 300, 'y' with size 300.
修改为:
import operator
from functools import reduceplt.scatter(X[0, :], X[1, :], c=reduce(operator.add, y), cmap=plt.cm.Spectral)
即可解决
关于“‘c‘ argument has 1 elements, which is not acceptable for use with ‘x‘ with size 300“的解决办法相关推荐
- -bash: /bin/rm: Argument list too long的解决办法
-bash: /bin/rm: Argument list too long的解决办法 当目录下文件太多时,用rm删除文件会报错: -bash: /bin/rm: Argument list too ...
- pycharm 黄色(黄字)高亮警告 Default argument value is mutable 原因及解决办法(mutable 可变对象与 immutable不可变对象)
示例 解决方案 按照参考文章的意思,classes=read_class_names(cfg.YOLO.CLASSES)在函数调用时就会创建对象并赋初始值,如果在函数中修改了classes的值,则函数 ...
- TypeError: __init__() got an unexpected keyword argument ‘任意数‘的原因及解决办法
本篇文章主要讲解 pymysql模块查询数据时报错 "TypeError: init() got an unexpected keyword argument '任意数'的原因及解决办法&q ...
- TypeError: argument 1 has unexpected type 'NoneType'(解决办法)
self.search.clicked.connect(self.search_information(e)) 在使用connect时,报TypeError: argument 1 has unexp ...
- 错误“checking build system type... config.sub: missing argument”的解决办法
背景:交叉编译avahi库时遇到错误"checking build system type... config.sub: missing argument" ,"conf ...
- latex出现runaway argument?错误的解决办法
早上在修改编译论文时发现了这个问题,仔细检查代码并没发现错误,一时也找不到具体的解决办法.我一直以为是因为runaway argument的错误提示,可实际上就是因为aux文件没有完整输入,导致上次编 ...
- Validation failed for argument [0] 参数校验失败的解决办法
问题概述 关于这个问题,是在接口参数校验的时候遇到的,使用Spring Boot下spring-boot-starter-validation进行接口参数校验时出现 " Validatio ...
- Python OSError: [Errno 22] Invalid argument:的解决办法
今天在用到open函数时,始终报OSError: [Errno 22] Invalid argument:的错误,发现解决办法有以下几种: 方法一:输入格式错误 f = open('F:\Python ...
- 有道报出: Encountered an improper argument解决办法
概述 出现的症状:在打开有道云之后使用划词翻译第一次可以使用之后就不能使用了,报出Encountered an improper argument 截图当时没截上百度截上来了 up主的解决办法是: 看 ...
最新文章
- 查看python安装路径
- RHCE课程-RH253Linux服务器架设笔记五-DNS服务器配置(2)
- css3 画半圆和1/4圆
- 牛客 数素数 (20)
- APK加壳【1】初步方案实现详解
- 多个python文件相互调用_用 python提取两个文件之间的内容
- android动态显示键盘,动态修改EditText输入键盘并隐藏或显示密码
- HYSBZ - 2243染色——树链剖分+线段树建树技巧
- python sqlite3事务_python使用上下文管理器实现sqlite3事务机制
- Pytorch 版YOLOV5训练自己的数据集
- Rabbitmq工作笔记009---access to vhost ‘/‘ refused for user 权限问题
- struts2 标签单选框_Struts 2 UI标签–表单,复选框,单选,选择,提交
- 深度学习自学(七):腾讯移动端开源框架ncnn学习总结
- Ubuntu 12.04 MTK环境配置说明
- unity使用BMFont制作位图字体
- MD5在线解密工具推荐
- SPI FLASH 波形测量演示实例
- java学习day10(Java基础)特殊类
- JVM学习笔记(12) 垃圾回收-垃圾回收相关算法
- GYM 101350E. Competitive Seagulls (博弈