成功解决IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (100,)

目录

解决问题

解决思路

解决方法


解决问题

Index Error: shape mismatch: indexing arrays could not be broadcast together with shapes (100,) (100,10)

解决思路

索引错误:形状不匹配:索引数组无法与形状(100,)一起广播(100,10)。
当使用其他整数类型的多维数组,访问numpy多维数组时,用于索引的数组需要具有相同的形状。numpy将会被允许去广播(如果可能的话),所以,若要为了实现这一点,数组需要具有相同的维数。

参考文章
Stack overflow:shape mismatch: indexing arrays could not be broadcast together with shapes
Indexing Multi-dimensional arrays

解决方法

使两个numpy数组保持形状一致即可!

成功解决IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (100,)相关推荐

  1. 成功解决IndexError: arrays used as indices must be of integer (or boolean) type

    成功解决IndexError: arrays used as indices must be of integer (or boolean) type 目录 解决问题 解决思路 解决方法 解决问题 I ...

  2. 成功解决IndexError: index 14 is out of bounds for axis 1 with size 14

    成功解决IndexError: index 14 is out of bounds for axis 1 with size 14 目录 解决问题 解决思路 解决方法 解决问题 IndexError: ...

  3. 成功解决IndexError: index 0 is out of bounds for axis 1 with size 0

    成功解决IndexError: index 0 is out of bounds for axis 1 with size 0 目录 解决问题 解决思路 解决方法 解决问题 IndexError: i ...

  4. 成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2)

    成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2) 目录 解决问题 解决思路 解决方法 解决问题 Valu ...

  5. 成功解决ValueError: Shape of passed values is (1, 332), indices imply (1, 1)

    成功解决ValueError: Shape of passed values is (1, 332), indices imply (1, 1) 目录 解决问题 解决思路 解决方法 解决问题 Valu ...

  6. 成功解决 ValueError: feature_names mismatch training data did not have the following fields

    成功解决 ValueError: feature_names mismatch training data did not have the following fields 目录 解决问题 解决思路 ...

  7. 成功解决TypeError: only integer scalar arrays can be converted to a scalar index

    成功解决TypeError: only integer scalar arrays can be converted to a scalar index 目录 解决问题 解决思路 解决方法 解决问题 ...

  8. 成功解决 ValueError: Shape of passed values is (2, 3), indices imply (4, 3)

    昨天整理了知识点,今天复盘时,发现了error,巩固dataframe的用法. 错误原因 file3 = pd.DataFrame(data = {'Gender':['M','F'],'Height ...

  9. 成功解决 shape = predictor(img, dets[0]) IndexError: Index out of range

    成功解决    shape = predictor(img, dets[0]) IndexError: Index out of range 目录 解决问题 解决方法 解决问题 shape = pre ...

最新文章

  1. linux 从行查看文件,linux 查看文件内容
  2. Windows API获取系统配置文件的配置参数
  3. Win7系统下Vmware虚拟机无法使用USB设备问题的解决方法
  4. 计算机网络第六章ppt课件,计算机网络与通信(第6章).ppt
  5. 服务器怎么虚拟化内存,服务器虚拟化内存大小
  6. C# 读取根目录的json文件中的某个值
  7. 2008年秋季学期文兴小学四年级班主任工作计划
  8. Linux如何搭建Java部署环境
  9. 【C#】[窗体]渐变窗口背景
  10. 学计算机 数学日记,数学日记3篇
  11. 金蝶KIS 14.1 专业版安装教程
  12. docker自动部署脚本
  13. 高端程序员上班摸鱼指南
  14. 第二篇:Spring Cloud Eureka 服务注册+发现
  15. OSChina 周三乱弹 —— 有种思念叫忘穿秋裤
  16. 【浪漫程序员系列】情人节给女友写代码表达爱意,让她感动到哭
  17. 以AI赋能企业数智化转型 容联“云端”服贸会完美收官
  18. 以下代码可以屏蔽掉alt+f4
  19. 有关获取android唯一识别号IMEI的问题
  20. 计算机网络学习笔记(详尽版)

热门文章

  1. android computescroll_Android Scroller与computeScroll方法的调用关系
  2. delphi 折叠代码 快捷键_我收藏的几个更快搬砖的vscode快捷键
  3. redis 数据完整性
  4. Android编译系统分析二:mm编译单个模块
  5. 【Windows10 IoT开发系列】开发人员模式设置
  6. DBI(i80)/DPI(RGB)/DSI【转】
  7. php钩子原理和实现
  8. Dos中通过Pause来阻止窗口运行就关闭
  9. 操作系统的极简教程(一)
  10. 一次毕生难忘的 Java 内存泄漏排查经历