我有一个浮点数的3D numpy数组。我是否索引不正确的数组?我想访问切片124(索引123),但看到这个错误:访问切片的3D numpy阵列
>>> arr.shape
(31, 285, 286)
>>> arr[:][123][:]
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
IndexError: index 123 is out of bounds for axis 0 with size 31
这个错误的原因是什么?
谢谢!并感谢对arr [:]作为arr的初始副本的澄清。我经常忘记这一点。 –