Does anyone know of a way to do an elementwise dot product with numpy?
import numpy as np
a = np.array([ [0,0,0],[0,0,1] ])
b = np.array([ [1,2,3],[1,3,2] ])
for i in range(0, size(a)):
c.append(np.dot(a[i],b[i]))
and I want c = [0,2] Also how would you about making a sequence of integers scalarly multiply a vector? So: a = [1,2] b = [0,1,0] Let the operation be oper oper(a,b) the result should be c = [[0,1,0],[0,2,0]] Thanks in advance