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