在学习python的时候,

看到有些 代码中使用array[0][0] 来提取位置元素

不太明白。

动手实验了一下

import numpy as np
a = np.array([np.arange(12),np.arange(12,24)])
>>>print a
[[ 0 1 2 3 4 5 6 7 8 9 10 11]
 [12 13 14 15 16 17 18 19 20 21 22 23]]

>>>print a[0][6]
6

[0][6] means: get the 1st array and the 7th element.

But what's the difference of [0,6]??
their are the same answer!!

>>>print a[0,6]
6