Python / Numpy What did he call / how do you represent this operation, where do you multiply each element of two vectors?

For example, suppose I have:

x = array([1, 2, 3])
y = array([4, 5, 6])

The standard "array multiplication" in python does z = x * y = array([4, 10, 18]). In Matlab, to get the same effect, you do *. IIRC.

What is called this operation, and what symbol is used to represent it?

+5
source share
4 answers

This is a work of Hadamard, presented by the open circle: http://en.wikipedia.org/wiki/Matrix_multiplication#Hadamard_product

+6
source

, S = sum_i (x_i * y_i)? . numpy:

from numpy import *
x = array([1,2,3])
y = array([2,2,2])
inner(x,y)          <-- Should give 1*2 + 2*2 + 3*2 = 12

, , , . * matlab, Schur/Hadamard, . , '*' numpy, , .

+1

.

, dot product, .

, cross product, .

, , .

, , , , .

+1

Not sure what you are asking. However, in MATLAB x * y is called matrix multiplication, while x. * Y caused by array multiplication.

0
source

All Articles