Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from __future__ import print_function
  2. import numpy as np
  3. x = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]).reshape(3,4)
  4. q = np.array([3, 4, 5, 6, 7, 8]).reshape(3,2)
  5.  
  6. print(x)
  7. print(q)
  8. ans = np.dot(x.T,q)
  9. print(ans)
  10. print(ans.flatten())
  11.  
  12. [[ 0  1  2  3]
  13.  [ 4  5  6  7]
  14.  [ 8  9 10 11]]
  15. [[3 4]
  16.  [5 6]
  17.  [7 8]]
  18. [[ 76  88]
  19.  [ 91 106]
  20.  [106 124]
  21.  [121 142]]
  22. [ 76  88  91 106 106 124 121 142]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement