import numpy as np
#创建矩阵 A
A = np.array([[1,2,3],[4,5,6],[7,8,9]])
B = A
C = np.array([[1,2],[3,4],[5,6]])
D = np.array([[1],[2],[3]])
print(B,'\n',C,'\n',D)
E = A+B
G = np.dot(A,B)
H = -A
print(E,'\n',G,'\n',H)
I = np.dot(A,D)
print(I)
print(np.transpose(I))
#创建矩阵 A
A = np.array([[1,2,3],[4,5,6],[7,8,9]])
B = A
C = np.array([[1,2],[3,4],[5,6]])
D = np.array([[1],[2],[3]])
print(B,'\n',C,'\n',D)
E = A+B
G = np.dot(A,B)
H = -A
print(E,'\n',G,'\n',H)
I = np.dot(A,D)
print(I)
print(np.transpose(I))
2020-07-28