[Numpy-discussion] Row-wise dot product?

T J tjhnson@gmail....
Mon Sep 7 04:34:16 CDT 2009


Is there a better way to achieve the following, perhaps without the
python for loop?

>>> x.shape
(10000,3)
>>> y.shape
(10000,3)
>>> z = empty(len(x))
>>> for i in range(10000):
...    z[i] = dot(x[i], y[i])
...


More information about the NumPy-Discussion mailing list