summaryrefslogtreecommitdiff
path: root/python/transpose.py
blob: 464194a792bdf264a68d76eb825ce4db9cfbd6c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python

import numpy as np

m = np.matrix('1 2; 4 5; 7 8; 9 10') # 3 x 2
v = np.matrix('1 2 3 4') # 1 x 3
print(m)
print(v)
print(v*m)
print((m.transpose()*v.transpose()).transpose())