a = [[1,2], [3,4]]
i = 0 # 取第一行
a[i] # 结果:[1, 2]
i = 0 # 取第一行
b = np.array(a)
b[i,:] # 也等价于 b[i],结果:array([1, 2])
i = 0 # 取第一列
[item[i] for item in a] # 结果:[1, 3]
i = 0 # 取第一列
list(map(lambda x: x[i], a)) # 结果:[1, 3]
i = 0 # 取第一列
b = np.array(a)
b[:, i] # 结果:array([1, 3])
b, c = a # b==[1, 2], c==[3, 4]
b+c # 结果:[1, 2, 3, 4]
b, c = a # b==[1, 2], c==[3, 4]
[*b, *c] # py3.5版本之后解包支持作用在表达式中,结果:[1, 2, 3, 4]
from itertools import chain
list(chain(*a)) # 或者 list(chain.from_iterable(a)),结果:[1, 2, 3, 4]
b = np.array(a)
b.flatten() # 结果:array([1, 2, 3, 4])