首页 > 解决方案 > 元组超出索引

问题描述

IndexError:元组索引超出范围

我收到了这个错误,我不知道为什么,因为我的代码看起来像

interpolated_mean = np.array([np.ones(X.shape[1])*self.means[digit] for digit in range(10)])

在哪里self.means返回

[0.2950995723007362, 0.35157590125195076, 0.37957208825304445, 0.3191758946180043, 0.35155769941304243, 0.3984539137236574, 0.3008216529579752, 0.3630624989356188, 0.4623879642875728, 0.33528044078766084]

标签: tuplesindexoutofboundsexception

解决方案


推荐阅读