1
我想使一个3维阵列这样一个:蟒3D阵列类似于C++
treedarray = [[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]]
在此表中,每一个值是(容易)访问通过使用:
treedarray [a] [b] [c]
我想知道是否有一个命令更容易做到这一点。
在此先感谢。
你似乎对Python比较陌生。请查看[Numpy](http://www.numpy.org/)。这是一个数字内容包,并提供了多维数组中的所有内容。如果你想在Python中进行数字化,基本上没有办法。 (顺便说一下,你可以通过'treedarray = numpy.zeros((3,3,3)''')使用numpy来开启你的数组。 – Carsten