矩阵转列表
from numpy import *
a = mat([[1,34,3],[2,3,41],[2,34,41],[2,53,41]])
print(a.flatten())
print(a.flatten().A)
#矩阵转为列表
print(a.flatten().A[0])
'''
[[ 1 34 3 2 3 41 2 34 41 2 53 41]]
[[ 1 34 3 2 3 41 2 34 41 2 53 41]]
[ 1 34 3 2 3 41 2 34 41 2 53 41]
'''