矩阵转列表

矩阵转列表

>>> testMat
matrix([[ 1.,  0.,  0.,  0.],
        [ 0.,  1.,  0.,  0.],
        [ 0.,  0.,  1.,  0.],
        [ 0.,  0.,  0.,  1.]])
>>> testMat[:,-1]
matrix([[ 0.],
        [ 0.],
        [ 0.],
        [ 1.]])
>>> testMat[:,-1].T
matrix([[ 0.,  0.,  0.,  1.]])
>>> testMat[:,-1].T.tolist()
[[0.0, 0.0, 0.0, 1.0]]
>>> testMat[:,-1].T.tolist()[0]
[0.0, 0.0, 0.0, 1.0]
>>>

dataSet[:,-1].T.tolist()[0])


posted @ 2017-12-26 15:05  crr121  阅读(175)  评论(0编辑  收藏  举报