>>>x=np.array([[1,2,3],[4,5,6]],float)# 2 by 3
Array([[19.,23.],]43., 53.]])
Alternatively, we could convert arrays into matrices first and then use * of matrix
multiplication as shown in the following lines of code:
>>>x=np.matrix("1,2,3;4,5,6")
Actually, we could convert an array into a matrix easily as follows:
>>>x1=np.array([[1,2,3],[4,5,6]],float)
原文:http://www.cnblogs.com/midforest/p/4968035.html