import numpy as np row1 = [1,2,3] row2 = [4,5,6] row3 = [7,8,9] arr = np.array([row1, row2, row3]) mat = np.mat(arr)
m1 = np.mat(np.random.rand(4,4)) m2 = np.mat(np.random.rand(4,4)) m1 * m2 # 螻 m1 - m2 # 谿 m1 - m2 # m1.I #覓語I -> eye(4) #
>>> from numpy import * >>> #る旭 >>> arr = random.rand(2,2)