访问多维数组的特定元素

时间:2017-05-20 18:08:15

标签: python

我有一个名为zSurface的多维数组,如下所示:

zSurface = np.array([[-4.38,-3.95,-3.6,-3.24,-1.14,-0.8,-0.5,-0.15],
       [-4.15,-3.8,-3.5,-3.18,-1.19,-0.87,-0.58,-0.24],
       [-4.04,-3.73,-3.45,-3.15,-1.22,-0.9,-0.62,-0.28],
       [-3.99,-3.69,-3.43,-3.13,-1.23,-0.92,-0.64,-0.31],
       [-3.98,-3.68,-3.42,-3.13,-1.24,-0.93,-0.65,-0.32],
       [-3.96,-3.66,-3.41,-3.12,-1.25,-0.94,-0.66,-0.33]])

有人可以告诉我是否要访问数组中的特定元素如何检索它。例如,我想将第3行第4列(-3.15)的元素分配给变量。

var = zSurface[3][4]工作吗?

0 个答案:

没有答案