Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. >>> a = np.array([1,2,3])
  2. >>> b = np.array([3,2,1])
  3. >>> a*b
  4. array([3, 4, 3])
  5. >>> np.dot(a,b)
  6. 10
  7. >>> b = np.array([[2,4,2],[2,3,1],[3,4,1]])
  8. >>> a = np.array([1,2,3])
  9. >>> a*b
  10. array([[2, 8, 6],
  11.        [2, 6, 3],
  12.        [3, 8, 3]])
  13. >>> np.dot(a,b)
  14. array([15, 22,  7])
  15. >>> b*b
  16. array([[ 4, 16, 4],
  17. [ 4, 9, 1],
  18. [ 9, 16, 1]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement