diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/transpose.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/python/transpose.py b/python/transpose.py new file mode 100644 index 0000000..464194a --- /dev/null +++ b/python/transpose.py @@ -0,0 +1,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()) + |