>>> a=[[1,2,3],[4,5,6]]
>>> a[0] #取一行
[1, 2, 3]
>>> a[:,0] #尝试用数组的方法读取一列失败
TypeError: list indices must be integers or slices, not tuple
>>> import numpy as np
>>> a=np.array([[1,2,3],[4,5,6]])
>>> a[:,0]
array([1, 4])
>>> a=[[1,2,3],[4,5,6]]
>>> a[0] #取一行
[1, 2, 3]
>>> a[:,0] #尝试用数组的方法读取一列失败
TypeError: list indices must be integers or slices, not tuple
>>> import numpy as np
>>> a=np.array([[1,2,3],[4,5,6]])
>>> a[:,0]
array([1, 4])