标签:transpose 转置 matrix python numpy
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit ( Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> a = numpy.mat([[1,2,3,4],[7,8,9,10]]) >>> a matrix([[ 1, 2, 3, 4], [ 7, 8, 9, 10]]) >>> b =numpy.transpose(a) >>> b matrix([[ 1, 7], [ 2, 8], [ 3, 9], [ 4, 10]]) >>> a.T matrix([[ 1, 7], [ 2, 8], [ 3, 9], [ 4, 10]]) >>>
标签:transpose 转置 matrix python numpy
原文地址:http://matrix6ro.blog.51cto.com/1746429/1791923