python - 为什么会出现“IndexError:元组索引超出范围”?
问题描述
为什么我会收到以下代码的以下错误消息:
X_test = []
for i in range(60, 90):
X_test.append(inputs[i-60:i, 0])
X_test = np.array(X_test)
X_test = np.reshape(X_test, (X_test.shape[0], X_test.shape[1], 1))
X_test = np.reshape(X_test, (X_test.shape[0], X_test.shape[1], 1))
IndexError:元组索引超出范围
为什么 for 循环不生成 30*60 矩阵?
解决方案
推荐阅读
- editor - 使用 Sublime Text 4 进行文本管道重定向
- variables - 管道变量到另一个失败
- node.js - 如何设置 getstream Winds 应用程序
- reactjs - 有没有办法从克隆的仓库中禁用 Prettier?
- python - 尝试在 Python 3 中创建不重复的随机变量列表,但无法正常工作
- javascript - 在 Firebase 可调用函数中抛出 HttpsError() 是否会导致实例被丢弃(并因此导致冷启动)?
- wordpress - 如何解决此错误“致命错误:无法重新声明检索密码()”
- graphql - GraphQL 查询 - 编写模式和解析器
- spring-boot - 升级到 Java 10,但在 Docker/Spring-Boot/Maven 设置中出现“致命错误编译:无效目标版本:10”
- xpages - 阻止转发或回复电子邮件