Issue
Is there a NumPy matrix/vector function that does,
[x1*y1]
[x2*y2]
x*y = [x3*y3]
[-----]
[xn*yn]
Solution
There is no method, just use *
For example, consider
import numpy as np
a = np.array([[0, 1, 2, 3, 4],
[5, 6, 7, 8, 9]])
b = np.array([[2, 2, 2, 2, 2],
[2, 2, 2, 2, 2]])
print(a * b)
This code returns
[[ 0 2 4 6 8]
[10 12 14 16 18]]
Answered By - Javier Lim
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.