In [19]:
import numpy as np
np.version
A = np.matrix([[1, 2, 3], [3, 4, 5]])
B = np.matrix([[3, 2, 1], [5, 4, 3]])
print('A:\n', A)
print('B:\n', B)
print('\nProperties:')
print('A - dimensions: ', A.shape)
print('A - no elements: ', np.prod(A.shape)) # same as A.size
print('\nOperations:')
print('A+B:\n', A+B)
print('A-B:\n', A-B)
B = np.matrix([[3, 2, 1, 0], [5, 4, 3, 0], [5, 4, 3, 0]])
print('A*B:\n', A.dot(B)) # (2, 3) * (3, 4) = (2, 4)
In [ ]: